Thursday, December 4, 2008

How to migrate Drupal to xampp for Development

Occasionally it is important to work on a local development machine. For this task I often use the xampp package, which mirrors a standard lamp stack.

To migrate an existing remote drupal site do the following:
  1. install xampp at c:\xampp
  2. modify c:\xampp\apache\conf\httpd.conf
    1. the line 'Listen 80' to 'Listen 88'
    2. If you had Clean URLs on your remote site (i.e. localhost/drupal/admin instead of localhost/drupal/?q=admin)
      1. #LoadModule rewrite_module modules/' to ' LoadModule rewrite_module modules/' (take out the #)
      1. AllowOverride None to AllowOverride All
    3. start apache and mysql from the xampp interface (you may need to change mysql configuration)
  3. copy over the following folders to a new 'drupal_remote_site' folder on your local machine
    1. Themes
    2. Modules
    3. Files
  4. if you don't already have the Backup and Migrate module on your remote machine, install it
  5. backup your database on the remote machine, copy this into the local folder 'drupal_remote_site'
  6. install the same version of drupal on your local machine which you had on your remote -- note: this downloads as a tarball which must be expanded and copied into within c:\xampp\htdocs\drupal (rename the copied folder as drupal from drupal-6.5 for instance)
  7. copy in your themes, modules, and files folder into this new drupal folder
  8. go to http://localhost:88/drupal/install.php, this will install necessary tables,etc. into the db
  9. now enable the Backup and Migrate module on the local machine
  10. use the 'Restore/Import DB' tab in drupal to import your db
  11. voila, all should be back to normal
Post a Comment