Future Meeting Idea - Deploying data between staging environments

Events happening in the community are now at Drupal community events on www.drupal.org.
oddencreative's picture

Is there a best practice for deploying between Dev, Staging, and Production? Who has worked with deploy. Are there other tools that people use to do the heavy lifting?

Comments

Hot topic

kristen pol's picture

Yes, this is a hot one... I use Features to help with deployment but would love to hear about Deploy and other methods.

Kristen

Great idea!

darrylri's picture

I would love to see how others do this, in detail. I haven't used Features to do this; I have been copying site images and database dumps around.

Maybe a new group?

andy inman's picture

I'm nowhere near Santa Cruz but interested in this topic - wondering if a new group here would be worthwhile - any supporters?

My staging sites work like this:

  • Staging site is a full copy (code, files, separate db.)
  • All core, module and theme updates are performed there to make sure nothing gets broken in the process (only important security updates get done directly on the live site.)
  • Content editors make any major changes on the staging site, so no messing around with "published" setting (minor changes/edits are done directly on the live site of course.)

Periodically we swap the sites - staging becomes live. This is done by simply renaming directories (live->temp, staging->live, temp->staging) and restarting Apache. Additionally, clearing Drupal page cache, if in use. We leave the old live site intact (now at the staging address) for a reasonable time just in case we need to revert the change for some reason. Then, we resync back from so that staging is up to date again. Typically this involves using rsync for the filesystem and the Backup/Migrate module for the database, either manually or using scripts/drush. We rsync everything in and below the Drupal root directory except settings.php (since that's where we pick up the separate database for each version of the site.)

Minor points:
* It's best to clear the Drupal page cache if used, since pages are cached by url.
* If the staging site has performance options turned off (caching, CSS optimization etc) then either manually set those on both sites or, probably better, have appropriate settings in settings.php via $conf[] variables.
* Any in-content references to files etc need to be relative, not absolute, otherwise things won't work as expected.

I've considered sharing the files directory between staging+live (e.g. using a symbolic link.) Pros and cons - for now I'm keeping them independent.



Currently part of the team at https://lastcallmedia.com in a senior Drupal specialist role.

Santa Cruz

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: