I'm trying to do something with a Capistrano task that is similar to the heroku db:pull
functionality if you are familiar with it.
I have a remote server. On that server I have a bunch of backups in the /path/db_backups/
folder. And in that folder there's a backup of the database everyday.
All I want to do is
- Download the latest backup on the client machine in /path/to/backups_dir/
- Untar it locally.
- Import it into local mysql db.
Anyone know of a good way to handle this? Is there a gem I am unaware of? Is there a script you have handy?
this is quite an old topic but here is how I handled it with Capistrano 3.
This will use your remote MySQL binary (for example, the one from your web server). You won't need a direct access to the MySQL server but MySQL binary must be installed on your remote server.
Then import to any MySQL database with %x
Hope this will help someone else.