augustash / capistrano-ash

August Ash recipes for Capistrano
http://augustash.com
MIT License
73 stars 12 forks source link

Database Backup on Database Remote Deployment #9

Closed Prattski closed 13 years ago

Prattski commented 13 years ago

Pete rocked our faces off by creating database deployment to_remote and to_local. A thought with deploying the database to the remote server, would be to create a backup copy of the database, and perhaps keep 2-5 of the most recent backups on hand on the server in case it was needed and something went wrong.

I see there is a task called 'backup:db' already. Perhaps this is already working, or part-way there. If so, this could be integrated in instead of writing a new task.

grafikchaos commented 13 years ago

right now it's pretty easy to fold the backup:db task into any full release deployment via the callbacks in the Capfile, so I guess I don't understand the necessity for adding the backup:db task to the db:to_remote — unless we're constantly deploying the database from a development environment to a remote environment which would seem to be very unlikely.

you can always make use of callbacks for those special projects:

# in your Capfile callback stack you could do:
before 'db:to_remote', 'backup:db'
before 'db:to_local', 'backup:db'

As far as the backup and backup:db tasks are concerned, they would probably need to be tweaked a bit b/c the task depend on capistrano's current_path variable so a previously released deployment is a dependency