Hi All

For a couple of years I am maintaining a couple of relatively simple sites (a personal blog + a common blog for several people few a couple of small own modules and a little customized theme). The sites are running on Dreamhost (i.e. I have ftp, shell access and pretty good web panel). Every time I want to upgrade something, I go through a painful procedure of:
1) making sure my local copy in subversion is indeed equal to what's on running on the web except for a couple of settings that differ local copy from the web copy (site root, database name)
2) taking site offline and backing up db
3) importing db to local computer (can be painful if local mySql installation doesn't alow for big files import and I need to prey that encodings on the web and local db match)
4) doing upgrade/change locally
5) taking site offline, uploading the changed code, but not DB (as offline one is not latest anymore), upgrading db on the web

That is a manual and quite error-prone process, especially since I do it several times a year max and every time have to re-learn the procedure.

I am sure that my tasks are quite standard, but there has to be a better way.
Which practices do you use for upgrading (and just backing up/restoring) your Drupal sites?
It would be great if you could point me to some tutorials or overviews. Or maybe the good procedure is that simple that you could describe it in a few sentences?

Best regards,
Artem.

P.S.
If it matters, my local computer is a Mac and in general I am familiar with programming, just not that much with web development. Most of my programming life was about desktop and mobile apps.

Comments

d_l’s picture

There will be a preferred drupal way .. I can't comment .. you'll have to search around ..

but to automate repeated tasks and to minimise errors (not just in drupal) a workflow scripting engine can be useful .. it will record the workflow you go through ..

for Mac see http://macosautomation.com/

for Windows see http://www.autohotkey.com

.....

postscript ..

while exploring ways of scripting the drupal installation workflow I found this tutorial on automating the installation of Drupal 7.x .. might be useful ..

http://arancaytar.ermarian.net/2009/12/17/install-drupal-7-script

jordana’s picture

Try taking a look at the Backup & Migrate module
I use it to backup and restore databases from my local and dev site.
Very easy, very quick and it automatically has the option to not select temp tables (e.g. watchdog etc).
There's also a backup & migrate files sub-module you can try out.

You should also take a look at drush which simplifies many of these processes as well.

Hope this helps you out some.
Good luck!

Artem’s picture

Thank you, guys

I'll have a look at backup and migrate. It's a pity I can't find a description of a full cycle done well: from the current version through local version in subversion to the next version.

Kirk’s picture

The vast majority of users just run a DB backup and download their files. Either using phpMyAdmin, Backup & Migrate or something similar. For smaller sites, that is really all you probably need to do.

You can greatly automate a lot of these processes if you use Drush.

Once you get beyond that, it really becomes more a matter of personal preference, so finding complete "how to" guides is going to be difficult. Especially once you start talking about using version control and the like.

dman’s picture

That's where drush helps heaps.
Using drush to synchronize and deploy sites.

Set up your site-aliases (a config array that details your connection requirements) and you can
cd /var/www/{local_site_drupalroot}
svn update (depends on how you use svn..
cd sites/{local_site_instance}
drush sql-sync @remotesite @localsite
drush update
...... test :-)
resolve anything
cd ../..
svn commit
... optional - drush can push the results up for you.

Drush works just great on dreamhost shell accounts