Drupal installation

Nov 29 2010

How to transfer your Drupal website from one server to another

There are many different ways to recreate your Drupal website on another server. Some people use phpMyAdmin tool to create a database dump for the original site and import it into a new database on the target server. However, I have found that this method doesn’t work very well. Many times the database import does not complete because the operation times out. The cache tables are too large and the operation times out before it can be completed.
 
The best way to transfer your Drupal site from one server to another is to use the Backup and Migrate module. Use the default settings and the cache tables will not be saved in your backup. You don't need them anyways.
 
1. Make a complete backup of all your Drupal website files
2. Use Backup Migrate module to make a backup of the site database. Use the default settings. Choose Gzip and download to your desktop computer.
3. Copy all Drupal files to root directory
4. Use phpMyAdmin to create a new database, user and password. Write down the details.
5. Run yoursitename.com/install.php
6. Fix any error messages and permission issues. Register Globals needs to be disabled.
7. Enter database name, user and password for database you created in step 4.
8. Go to Site Building > Modules in your Admin Menu and look for Other category. Enable Backup Migrate module. Click Save Configuration.
9. Go to Content Mangement in your Admin Menu and choose Backup & Migrate
10. Choose Restore database and choose the gzipped database file you made in Step 2.
This will restore all your database settings and content from the original Drupal website
11. Check the settings for Site Configuration > File System. Many servers have different paths for the /files  and /tmp folders
12. Test your website to see that all pages are functioning properly.
13. Check Reports > Status Report. If you are transferring your Drupal website from a Microsoft server to a Linux server or vice versa, you will most likely need to run update.php to make sure your database structure is correct. Even if you are transferring from one Linux server to another, you will probably need to run update.php. Be sure to put the site off-line first.  Go to Site Configuration > Site Maintenance and choose site off-line.
 
I hope you find this article helpful. Please leave your comments below. I look forward to hearing from you. :-)