Joe, I've been working on just such a situation. While it's not perfect, here's the basic approach I've taken, bear in mind this is just for the db, but can be easily modified to account for files too.
* Create a task, using your example, call it :backup_db. In it, use drush sql dump on the remote host to generate a sql dump of your db, than use download to pull that file. * Create another task, again following your example, called :import_db. Use upload to put your sql dump on the server, than using drush again, run drush sql cli to import your db. Assuming you're running multistage, you can than simply run: `cap development backup_db` `cap staging import_db` And you're done. I've done this for my company in alot more detail, breaking out each step into separate atomic actions, save, download, upload, import, along with commands to import the dump into a local development database, and push that database to hosts, via a simple pull/push commandset, but I hope this gets you pointed in the right direction. -Tim Stackhouse We can only see a short distance ahead, but we can see plenty there that needs to be done. --Alan Turing, 1950 On Tue, Mar 23, 2010 at 2:28 PM, joe <[email protected]> wrote: > Hello all, > > I'm trying to figure out how to make a task that will move a directory > from my dev server to my staging server (this is the server I'm > deploying to with Capistrano). The dev server information is only > located in the :repository variable, which is kind of useless for what > I want to do. > > Ultimately, I need to copy a directory that isn't tracked by Git from > dev to staging as well as dump my (drupal) database on dev, send it to > staging, and import it. I can obviously do this "manually" with a > scp, mysqldump, etc., but figuring it into a deploy.rb is kind of > confusing me. > > Here's my current deploy.rb -- http://pastie.org/883249 > > I'm thinking I'd need to add a couple of tasks to my drupal > namespace, :backup_db, :copy_files, :import_db (maybe?) and then do > what I need to do there. I guess I just don't get how I'd communicate > with the different servers within the tasks. > > Thanks in advance! > > - Joe > > -- > * You received this message because you are subscribed to the Google Groups > "Capistrano" group. > * To post to this group, send email to [email protected] > * To unsubscribe from this group, send email to > [email protected] For more options, visit this group at > http://groups.google.com/group/capistrano?hl=en > > To unsubscribe from this group, send email to > capistrano+unsubscribegooglegroups.com or reply to this email with the words > "REMOVE ME" as the subject. > -- * You received this message because you are subscribed to the Google Groups "Capistrano" group. * To post to this group, send email to [email protected] * To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/capistrano?hl=en To unsubscribe from this group, send email to capistrano+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
