Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drush "archive-dump" command #136

Open
haunted2 opened this issue Mar 7, 2018 · 4 comments
Open

drush "archive-dump" command #136

haunted2 opened this issue Mar 7, 2018 · 4 comments

Comments

@haunted2
Copy link

haunted2 commented Mar 7, 2018

I would like to see this command available for backdrop.
Thanks.

@jerry-hudgins
Copy link
Member

So would I, though I've worked around its absence for now via a Bash script which emulates the basic single-site backup/restore functions via tar and the existing drush sql-dump/sql-drop/sql-query commands. Let me know if you'd like a copy.

@serundeputy
Copy link
Member

@jerry-hudgins that sounds good; want to post a repo URL or a gist? or turn it into a PR against backdrop drush here?

@jerry-hudgins
Copy link
Member

As this is no more than a quick workaround, it's probably best to just attach it here for those who might find it useful until the proper archive-dump command is implemented. It's working OK for me.

maintenance_mode.php is a drush script and should go in ~/.drush/commands/backdrop .
bdbackup and bdrestore can go where you like; I use ~/bin .

bdbackup keeps the last BACKUP_COUNT (currently 5) copies of the archive in BACKUP_DIR (currently ~/drush-backups), renaming older copies by adding .1, .2, etc. to their filenames. It can be run manually or from cron; if -c (cron) is specified as the first argument, it suppresses output and switches maintenance mode on and off around the backup operation (using maintenance_mode.php). bdrestore will wipe the database tables and files (if they exist) before restoring. It should be executed from outside the Backdrop home directory. If the DB doesn't exist, you'll have to create it manually.

You should adjust the definitions for your environment, such as the location of drush.

bdbackup.zip

@serundeputy
Copy link
Member

serundeputy commented Mar 7, 2018

@jerry-hudgins thanks!

we use this on backdropcms.org which can be run on cron as well; it backs up files and db, with a specified number of backups to keep before rolling over stale copies and we use git to backup the codebase.

https://github.com/serundeputy/sql-dump-sanitize

In case that is helpful for now @jerry-hudgins or @haunted2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants