Restore an environment from a backup

Once you have backups of your environment, you can restore data from a previous point.

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

1. List available backups 

To restore an environment, first select one of the available backups:

Run the following command:

platform backups

You get a response similar to the following:

Backups on the project My Project (1234567abcdef), environment main (type: production):
+---------------------------+----------------------------+------------+
| Created                   | Backup ID                  | Restorable |
+---------------------------+----------------------------+------------+
| 2022-08-15T09:48:58+01:00 | 5ouvtgo4v75axijww7sqnftste | true       |
| 2022-07-09T14:17:17+01:00 | 7jks7dru5xpx5p5id5wtypur2y | true       |
| 2022-06-22T18:33:29+01:00 | f3jbyxlhtmalco67fmfoxs7n4m | true       |
+---------------------------+----------------------------+------------+

Select one of the backups marked as Restorable and copy its Backup ID.

  1. Navigate to the environment where you want to see backups.
  2. Click Backups.

Select one of the backups marked as having completed successfully .

2. Restore from a backup 

To restore the backup you’ve selected, follow these steps:

  1. Run the following command:

    platform backup:restore BACKUP_ID
  2. Press enter to agree with the consequences and continue.

  1. Next to the backup you’ve selected, click More .
  2. Click Restore.
  3. Read through the consequences and click Yes, Restore.

The data is restored and your backed-up environment is deployed. This deployment uses the built app, including variables, from when the backup was taken. But the Git repository stays as it was before the restore, not when the backup was taken. So any future (re)deployments use the current Git repository to build the environment.

Restore to a different environment 

You can restore backups to a different environment than they were created on using the CLI:

  1. Switch to the branch where the backup was created.

  2. Run the following command:

    platform backup:restore --target=<TARGET_BRANCH_NAME> <BACKUP_ID>

Supported regions 

Restoring backups to different environments is 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 to restore to different environments now, migrate your project to a newer region.

You can also open a support ticket to ask that a backup be restored to a different environment for you.