Back up environments

When you’re making changes to your apps, you want to be sure those changes only improve things and don’t make you lose any data. You also want to have a disaster recovery plan in place. Backups help you protect yourself against potential data loss.

Backups represent a complete snapshot of an environment’s data. This includes all persistent data from all running services and any files stored on mounts. The snapshot is stored internally and can’t be downloaded. Code is managed through Git and so isn’t included. You can restore previous code using Git commands such as revert.

You might want to make backups of your live environment before merging a different environment into it or each time you increase the storage space of your services.

You also have regularly scheduled automated backups of your production environments to cover most cases.

You can only backup and restore active environments. To work with an inactive environment, first activate it.

To back up an environment, you need an Admin role for that environment type.

Backups and downtime 

By default, triggering a manual backup causes a momentary pause in site availability so that all requests can complete. This means the environment is backed up in a known consistent state. The total interruption is usually only 15 to 30 seconds. Any requests during that time are held temporarily, not dropped.

To avoid this downtime, use live backups.

For consistent backups, create the backups during non-peak hours for your site.

Retention 

For information on how long backups are retained, see the data retention policy.

Backup schedule 

Backups for Dedicated environments have a specific frequency.

On Grid environments, non-Production environments can have up to 2 manual backups. The number of available backups for Production environments depends on your schedule.

Schedule Manual backups Automated backups
Essential 2 2: daily
Advanced 4 21: daily, weekly, and monthly
Premium 4 44: 6-hourly, daily, and monthly

The schedules available to you depend on your tier.

Tier Default schedule Possible upgrade
Professional Essential Advanced
Enterprise/Elite Advanced Premium

An upgrade comes at an additional cost. The exact cost depends on the size of your storage.

Change your backup schedule 

To upgrade to the higher schedule, follow these steps:

  1. In the Console, navigate to the project where you want to change the schedule.
  2. Click Settings.
  3. Click Edit plan.
  4. For Backups, click the name of your current schedule. If clicking has no effect, you are already on the highest available schedule.
  5. Select the target schedule.
  6. Click Save.

To downgrade to the lower schedule, contact support.

Use automated backups 

For Dedicated environments, see more about backups of Dedicated environments.

For Grid environments, automated backups are taken for Production environments at least once every day. The exact number of backups depends on your backup schedule.

Daily backups are taken at around 4:00 every day based on the project timezone. The time for 6-hourly backups is based on the daily backup.

Automated backups are always live.

Supported regions 

Live automated backups are available on all regions except the legacy regions:

  • eu.platform.sh
  • us.platform.sh

These regions will be upgraded in the future. If youโ€™re on one of these regions and want live automated backups now, migrate your project to a newer region.

Live backups 

You can create backups without any downtime. This means your environment is running and open to connections during the backup.

Because the connections may come in during backup creation, live backups may have data inconsistencies among containers. They may make restorations less reliable. To avoid such issues, schedule manual backups during non-peak hours, when the short amount of downtime is least noticed.

Automatic backups are always live, including those taken on Dedicated Gen 3 and Dedicated Gen 2 environments.

You can create a manual live backup on a Grid project:

Use the --live flag:

platform backup:create --live
When creating the backup, select Run live backup in the last step.

Supported regions 

Live backups are available on all regions except the legacy regions:

  • eu.platform.sh
  • us.platform.sh

These regions will be upgraded in the future. If youโ€™re on one of these regions and want live backups now, migrate your project to a newer region.

Create a manual backup 

You can create a manual backup using the CLI or in the Console.

platform backup:create
  1. Navigate to the environment you want to back up.
  2. Click Backups.
  3. Click Backup.
  4. Click Backup.

Automate manual backups 

You can also automate the process of creating manual backups through cron jobs. The cron job uses the CLI command to back up the environment. It requires you to set up the CLI on the environment with an API token.

Although this process is automated, backups created in this way count as manual for the backup schedule. They don’t affect the automated backups taken as part of the schedule.

Physical storage location 

Backups are stored as binary large objects separate from your environments. This storage is replicated over multiple data centers in different locations. This means that in the rare event a data center becomes unavailable, your backups are still available.