Migrating/deploying Drupal 6 sites

Hi!

This is my first posting in a Drupal group, and I am a bit of a rookie with Drupal. Slowly getting there though...

I have a question that you guys may be able to help me out with. Is there any simple and practical way in which a Drupal installation (including database) can be copied from one machine to another? The reason behind the question is that I am planning to have a live (production) instance of Drupal for my service, and then a staging and a development environment. The first two will run on Linux boxes while the development will be running on a Windows XP Pro machine.

Typically, I would clone the production environment to the dev environment before I start working on it. When development is done, I would deploy the code & data into the staging environment, and if the tests are successful, do a deployment into the production environment.

All ideas and pointers are highly appreciated!

Sincerely,

Nils Hagner

Groups:
Login to post comments

Well...

greg.harvey - Tue, 2008-12-16 19:49

You could easily dual-boot the Windows machine with Fedora (free Linux desktop closest to CentOS, which is most likely to be the OS on your servers).

But assuming you don't want to do that, tips:

  • #1 is make sure you use a version control system like Subversion to manage and deploy your code. It will make things much easier.
  • #2 is create a c:\tmp directory on the Windows machine so you can leave the system temp files directory as "/tmp" in Drupal for Windows and Linux systems and it will work fine...
  • #3 is make sure you keep settings.php files for each environment checked in to version control, e.g. settings.php.dev, settings.php.stage and settings.php.live - keep settings.php OUTSIDE of version control and rename the appropriate settings file to settings.php after checking it out on to the appropriate system.
  • #4 never copy the cache tables between systems - you can get really ugly results. Do a mysqldump to take copies of your database(s) and use the --ignore-table option to not dump the cache tables.

There are more, but I have a baby on my knee and she's getting fed up... ;-)


VMWare

nicholasThompson's picture
nicholasThompson - Sun, 2009-01-04 11:32

I cant recommend VMWare enough. I have a Mac Laptop, but have also used it under Windows XP Pro. In that you can install a copy of Linux and be up and running with a 'virtual' server in around an hour.

You can use mysqldump or a script like this: http://www.thingy-ma-jig.co.uk/blog/26-11-2008/backing-drupal-database
That script does a structure only dump for certain tables (watchdog, cache*, etc)...


I'm using VMWare

kgp_developer - Sun, 2009-01-04 13:02

Instead of Dual-booting, you could use VMWARE. Install vmware tools and samba. You can share files between guest operating system and host.

VMWare and Ubuntu works almost perfectly together except that some keys on Windows XP (Guest system) are not working. Maybe it's my keyboard. I'm not sure.

I don't see any problem with migrating a drupal site (Only reason why I use Linux is that I'm a rails developer as well.). I used to work on xampp (Windows) and it's very easy to deploy a drupal 6 site. You can even use modules like backup & migrate.
http://drupal.org/project/backup_migrate

Also as Greg Harvey noted, the "tmp" directory should actually be within the root of your drupal 6 site and not on the /tmp directory specified by apache. Create a new tmp directory and change read and write permissions to 777 (or in Windows, uncheck read only option). Then change the settings on drupal. This helps if you're using shared hosting.