How to Copy/Move a Drupal/Acquia Site
Moving a Drupal site isn't as easy as copying content, or even jsut copying the database, especially if you are changing URLs, server names, database names, etc. This article assumes a Drupal site deployed in IIS 7.5 with Web Platform tools, but most of the steps are either compatible with, or have alternatives with other stacks.
To move/copy a Drupal/Acquia site there are a few pieces to consider:
- Site Content
- Site content variables
- Site Database
- IIS/Acquia helpers
The workable process to move/copy a site is this (for our example we will use a server called web01):
- Right click on the site you want to copy in IIS and select the deploy/export, and export the entire site to a zip file
- Alternately, you can just zip up the entire content folder for this site (typically a folder somewhere under \inetpub)
- Use phpMyAdmin to export the database used by the site to a .sql file
- Use the IIS deploy/import function to import the last exported zip file into the new site, make sure to remove the subpath as you want this application deployed into the root
- Alternately (per the zip method) in file explorer copy the entire site folder to a new folder and name it per the new site
- Create a new site in IIS (defaults) and point it to this folder
- Use phpMyAdmin to create a new empty database for the new site
- Use phpMyAdmin to import the /sql file you exported into this new database
- Use phpMyAdmin 'privileges' tab to grant the appropriate permissions to the drupaluser account (global)
- Go into the new site content folders and navigate to [new site]/site/default and edit the settings.php file, change the db connection string to the name of the new db
- Use a browser to connect to the new site to "http://[new_site]/install.php" ; this page should say it is already installed and have no errors
- The go to the URL "http://[new_site]/?q=user/login and login
- Then go to the URL "http://[new_site]/update.php" , use the site maintenance link to put the site in offline mode, then use the update function to update the site
- Use the maintenance link again to put the site back online again
- Go to the "site configuration/site information" menu and change the site name to the public URL of the new site
- You are finished!