Migrating/deploying Drupal 6 sites

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

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

Comments

Well...

greg.harvey's picture

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

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

kgp22's picture

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.

Even a clock that does not tick is right twice in a day.

back up drupal 6 database and files

bharathkanichar's picture

could anyone help me to backup my website files and the database,i used the backup module and the site crashed,suggest me better module

http://drupal.org/project/bac

bloke_zero's picture

http://drupal.org/project/backup_migrate crashed? It's generally pretty good. You could use PHPMyadmin if it's installed on your server, or you can see what the error was and fix that, maybe not enough memory for PHP or something?

Either check the logs (php error logs) or look here if it just white screens:

http://drupal.org/node/158043

Then you'll be able to see the error and take appropriate action to set up your server environment

Drupal lives in two worlds:

valeriod's picture

Drupal lives in two worlds: the file system and the database.

To backup the file system I use

tar -czvf drupal_root_dir_YYYY-MM-DD.tgz drupal_root_dir

If you don't have SSH access you can use cpanel or whatever backup system your hosting facility provides.

To backup the database I use the MySql GUI tools or the command line (command below is one line):

mysqldump --opt --skip-lock-tables --quote-names --user=the_db_user 
--password=the_pwd  dbname > dbname_YYYY-MM-DD.sql

If you don't have SSH access you can use cpanel, phpAdmin or whatever system your hosting facility provides.

The bottom line is that you need to generate two files: the file system backup and the database backup. That's your Drupal site.

Deploy content

snehi's picture

You can use deploy module
http://drupal.org/project/deploy

London

Group categories

Location

Group notifications

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