Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
At the moment it is not possible to give a backup filename as a command line parameter when using drush bam-backup command.
Usecase:
I want to automate the process of updating the staging server from dev. This would include these steps:
- drush sql-sync and rsync from dev server
- git pull and drush bam-backup on staging server
It would be very convenient to put the git commit id and commit message to the backup filename so it would be easily identified afterwards.
Example:
---Add-views-module.mysql.gz
Solution:
Add a file name parameter to bam-backup command that would override the default naming scheme if defined.
Comments
Comment #1
jiv_e CreditAttribution: jiv_e commentedComment #2
amanire CreditAttribution: amanire commentedHi jiv_e,
I had been using a custom drush script to concatenate the git commit branch and hash into filenames. I realized that this could and probably should be done with backup and migrate, with a few custom tokens, but the random profile IDs used by BAM were a bit of a disappointing setback. However, I discovered that I could just manually change them in the backup_migrate database tables. So once I set up the profile and destination, I can just use
or something to that effect.
Comment #3
amanire CreditAttribution: amanire commentedActually, I'm now realizing that the fact that Backup and Migrate stores the profile settings in custom tables is a real limitation with the profile approach, since I want local environments settings.php to be able to override the paths in the DB.
Comment #3.0
amanire CreditAttribution: amanire commentedFixed typos
Comment #4
JordanMagnuson CreditAttribution: JordanMagnuson commentedHas any work been done on this? Would a patch be accepted?
I also want to be able to define a custom file name when backing up via drush bam-backup.
Comment #5
jiv_e CreditAttribution: jiv_e commentedComment #6
jiv_e CreditAttribution: jiv_e commentedI was going to do this, but it wasn't crucial so I forgot it. Sorry that I didn't unassign.
Patches welcome!
Comment #7
couturier CreditAttribution: couturier as a volunteer commented