Move Your Drupal Site to a New Location

This tutorial will show you how to move your Drupal site from one server to another. This example uses two live servers, however the same principles also apply for moving to or from a local server.

Your Drupal Site

I'm going to move a straight-forward Drupal install to a new location. Each Drupal site has two halves - the files and the database. We're going to move one and then the other. Finally we'll make sure they can talk to each other.

Download the Files to Your Desktop

Step 1 is to download all of your Drupal site's files to your desktop.

Upload the Files to Your New Server

Step 2 is to upload them all your new server.

Export Your Old Database

For accesing the Drupal database I'm using phpMyAdmin which is commonly used by hosting companies and localhost setps. Find your site's database and click on "Export".

You'll need to export your database as SQL. I've chosen to also compress it using Gzip so that the process is a little quicker. Finally click Go.

Import to the New Database

I'm also using phpMyAdmin at the new site. Click "Import".

Choose the file that you just exported and click "Go" to import it into the new database.

Check to make sure that all the tables have imported sucessfully.

Change Settings.php

Finally we need to make sure that our files and database can talk to each other.

Login to your site's files and go to /sites/default/ and open settings.php. There are two things you'll need to change.

On line 92, chang the $db_url line to reflect the new database name, username and password.

On line 125, change $base_url to reflect the location of your new site.

That's it. Visit your Drupal site in it's new location and it should be live.