Indeed, not a clear part of the backup.
Many modifications happened on this matter.
We were, a not so long time ago, using backup_core_only
as a config set into the settings.yml of an app.
But it was source of many issues when the backup wasn’t properly done. We were ending up with the setting still in the config and still used for all backup. Even when not willing to.
So, here the current status of that, which is quite stable.
-
An user can set the setting
do_not_backup_data
to 1 into the config of an app to prevent data to be backed up by the backup script at any moment.
This is an action from an user, which will affect all backups made for the app.
(Side note, this should be into a config-panel) -
Otherwise, the main use case of creating a backup without data is the backup made before the upgrade of the app.
The helperynh_backup_before_upgrade
does set the environment variableBACKUP_CORE_ONLY
to 1 when doing the backup.
BACKUP_CORE_ONLY=1
does the same thing asdo_not_backup_data
, but it affects only the current shell. So this variable can be used to force a backup without data, but does not affect subsequent backup afterward.
Aside of the helper itself, this variable is useful for personal backup scripts.
- Finally, the argument
is_big
is to be used with the helperynh_backup
to specify into your app backup script, which part of the backup is considered as potentially big data an user could not want to backup.
Be careful though that, as this part of your app may not be backed up, you should not remove it either in your remove script.
Otherwise, a failed upgrade will remove the data and restore the app without it ! Not cool !