With Git 27 (not yet released but coming soon), when you restore a backup on Upsun, we are by default restoring the resources to their state when the backup was taken.
This applies mainly for when you restore a backup to an existing environment. In this case, the containers are (probably) still running on this environment, so when you restore the backup, the resources of these containers are by default set back to what they were when the backup was taken.
It's a bit different for new containers, where the resources initialization strategy (--resources-init option) is used to initialize the resources of these new containers. Knowing that there are only 2 cases when new containers are initialized => 1) when you restore to a new environment, in that case, all containers are new, or 2) when you restore to an environment where you have removed some containers since the backup was taken, in that case, these removed containers will be restored using the resource initialization strategy.
Description of the changes to be made
1- Just like we have a --no-code option to not restore the code, we would like to add a --no-resources option to not restore the resources.
With git 27 (https://api.platform.sh/docs/#tag/Environment-Backups/operation/restore-backup), the API will have a restore_resources key in its payload, similar to the restore_code one.
2- In the help text of the --resources-init option (upsun backup:restore --help), update the default when the option is not set to backup instead of parent.
Context
With Git 27 (not yet released but coming soon), when you restore a backup on Upsun, we are by default restoring the resources to their state when the backup was taken. This applies mainly for when you restore a backup to an existing environment. In this case, the containers are (probably) still running on this environment, so when you restore the backup, the resources of these containers are by default set back to what they were when the backup was taken. It's a bit different for new containers, where the resources initialization strategy (
--resources-init
option) is used to initialize the resources of these new containers. Knowing that there are only 2 cases when new containers are initialized => 1) when you restore to a new environment, in that case, all containers are new, or 2) when you restore to an environment where you have removed some containers since the backup was taken, in that case, these removed containers will be restored using the resource initialization strategy.Description of the changes to be made
1- Just like we have a
--no-code
option to not restore the code, we would like to add a--no-resources
option to not restore the resources. With git 27 (https://api.platform.sh/docs/#tag/Environment-Backups/operation/restore-backup), the API will have arestore_resources
key in its payload, similar to therestore_code
one.2- In the help text of the
--resources-init
option (upsun backup:restore --help
), update the default when the option is not set tobackup
instead ofparent
.