Drupal Tutorials and Blog Posts

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

tutuploadsmedia_1284064777892.png

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

tutuploadsmedia_1284064850534.png

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

Upload the Files to Your New Server

tutuploadsmedia_1284065113738.png

Step 2 is to upload them all your new server.

Export Your Old Database

tutuploadsmedia_1284065247021.png

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".

tutuploadsmedia_1284065288199.png

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

tutuploadsmedia_1284065461180.png

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

tutuploadsmedia_1284065493032.png

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

tutuploadsmedia_1284065582137.png

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

Change Settings.php

tutuploadsmedia_1284066038140.png

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.

tutuploadsmedia_1284066088958.png

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.

Comments

 
asia
#1 asia 2012-01-30 15:34

I am confused about a few issues
1- how can i upload folders into my online host? i see in the drupal files to move there are folders
2-can u kindle write a clear example of how the modifications on line 92 and 125 will look like? my site name on local host is simply drupal
3-what about the .index page on my site? do i have to delete it or .php will just take over.
4-do i have to upload the drupal files in the folder where my other files are index files etc
 
 
Nick
#2 Nick 2012-02-01 09:14

Hi and welcome, asia!

Those are good questions! We would love to get into a discussion with you on this. If you are a student at OSTraining.com, please log into the support forum (www.ostraining.com/.../) and post the questions in there, so that one of our support techs can look into it for you. If you’re not a student, I hope you’ll consider becoming one, so that we can give you the attention you deserve. You can find out more about our online class at www.ostraining.com/online

Kind regards,
Nick
 
 
MARIO
#3 MARIO 2012-10-15 11:45

for transfer your localhost to godaddy, is different
the hostname is like yourdatabase.db .7774631.hosted resource. in yoyr db_url

see this help page: support.godaddy.com/.../...

no changes for base_url
 

Add comment


Security code
Refresh

blog-ad

Start Online Training

Members get access to all our video training. That's 1,244 training sessions in Joomla, Drupal, WordPress and Coding.

Latest Comments

The License for Our Tutorials

All of our tutorials are published under the Creative Commons Attribution-NonCommercial license. This means:

  • You can re-use these tutorials.
  • You can modify these tutorials.
  • You must link back to our original tutorial.
  • You can't use these tutorials commercially.

Click here to read the full license.

Copyright 2013 Open Source Training, LLC. All rights reserved.