Upgrading | laravel-backup-server | Spatie

 SPATIE

  Laravel Backup Server
========================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-backup-server](https://spatie.be/docs/laravel-backup-server/v4)  Upgrading

 Version   v4   v3   v2   v1

 Other versions for crawler [v4](https://spatie.be/docs/laravel-backup-server/v4) [v3](https://spatie.be/docs/laravel-backup-server/v3) [v2](https://spatie.be/docs/laravel-backup-server/v2) [v1](https://spatie.be/docs/laravel-backup-server/v1)

- [ Introduction ](https://spatie.be/docs/laravel-backup-server/v4/introduction)
- [ Installation &amp; setup ](https://spatie.be/docs/laravel-backup-server/v4/installation-setup)
- [ Requirements ](https://spatie.be/docs/laravel-backup-server/v4/requirements)
- [ Upgrading ](https://spatie.be/docs/laravel-backup-server/v4/upgrading)
- [ Questions and issues ](https://spatie.be/docs/laravel-backup-server/v4/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-backup-server/v4/changelog)
- [ About us ](https://spatie.be/docs/laravel-backup-server/v4/about-us)

Taking backups
--------------

- [ Creating a destination ](https://spatie.be/docs/laravel-backup-server/v4/taking-backups/creating-a-destination)
- [ Creating a source ](https://spatie.be/docs/laravel-backup-server/v4/taking-backups/creating-a-source)
- [ Taking backups ](https://spatie.be/docs/laravel-backup-server/v4/taking-backups/taking-backups)
- [ The backup process ](https://spatie.be/docs/laravel-backup-server/v4/taking-backups/the-backup-process)
- [ Events ](https://spatie.be/docs/laravel-backup-server/v4/taking-backups/events)
- [ Listing sources and destinations ](https://spatie.be/docs/laravel-backup-server/v4/taking-backups/listing-sources-and-destinations)
- [ Working with backups ](https://spatie.be/docs/laravel-backup-server/v4/taking-backups/working-with-backups)
- [ Creating database backups ](https://spatie.be/docs/laravel-backup-server/v4/taking-backups/creating-database-backups)

Cleaning up backups
-------------------

- [ The clean up process ](https://spatie.be/docs/laravel-backup-server/v4/cleaning-up-backups/the-cleanup-process)
- [ Determining old backups ](https://spatie.be/docs/laravel-backup-server/v4/cleaning-up-backups/determining-old-backups)
- [ Events ](https://spatie.be/docs/laravel-backup-server/v4/cleaning-up-backups/events)

Monitoring the health of all backups
------------------------------------

- [ The monitoring process ](https://spatie.be/docs/laravel-backup-server/v4/monitoring-the-health-of-all-backups/the-monitoring-process)
- [ Checking health of sources ](https://spatie.be/docs/laravel-backup-server/v4/monitoring-the-health-of-all-backups/checking-health-of-sources)
- [ Checking health of destinations ](https://spatie.be/docs/laravel-backup-server/v4/monitoring-the-health-of-all-backups/checking-health-of-destinations)
- [ Events ](https://spatie.be/docs/laravel-backup-server/v4/monitoring-the-health-of-all-backups/events)

Sending notifications
---------------------

- [ Sending notifications ](https://spatie.be/docs/laravel-backup-server/v4/sending-notifications/sending-notifications)
- [ Adding extra notification channels ](https://spatie.be/docs/laravel-backup-server/v4/sending-notifications/adding-extra-notification-channels)
- [ Customizing the notifiable ](https://spatie.be/docs/laravel-backup-server/v4/sending-notifications/customizing-the-notifiable)
- [ Pausing failed notifications ](https://spatie.be/docs/laravel-backup-server/v4/sending-notifications/pausing-notifications)

 Upgrading
=========

###  On this page

1. [ From v3 to v4 ](#content-from-v3-to-v4)
2. [ From v2 to v3 ](#content-from-v2-to-v3)
3. [ From v1 to v2 ](#content-from-v1-to-v2)

From v3 to v4
-----------------------------------------------------------------------------------------------

#### Breaking changes

- **New column**: Add a nullable `pause_notifications_until` column (type: `timestamp`) to the `backup_server_sources` table. This column allows you to specify when to resume notifications.

**Migration**

Copy and paste this migration into your project:

```
return new class extends Migration
{
    public function up(): void
    {
        Schema::table('backup_server_sources', function (Blueprint $table) {
            $table
                ->timestamp('pause_notifications_until')
                ->after('healthy_maximum_storage_in_mb')
                ->nullable();
        });
    }
}

```

From v2 to v3
-----------------------------------------------------------------------------------------------

v3 add compatability with Laravel 9 and Flysystem v3. We had to create this release to make sure our code works with the new dependencies. The public API was not changed.

You can upgrade without making any changes.

From v1 to v2
-----------------------------------------------------------------------------------------------

- remove the `backup_hour` column in the `backup_server_sources` table.
- add a column `cron_expression` (varchar, 255) to the `backup_server_sources`. This column should hold a value cron expression that will determine when the source will be backed up. Here's the value when you want to run a backup each day at 2am: `0 2 * * *`
