Move Your Drupal Site to a New Location

tutuploadsmedia_1284064777892.png

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.

{loadposition drupalnewsletter}

Author

  • Robbie Adair

    Robbie started her career in corporate training until starting her own custom training and media company almost seventeen years ago. In 2010, she began doing classroom training for OSTraining while running Media A-Team. She is often presenting about various tech topics such as Joomla, Fabrik, Web Development, Social Media, and Augmented Reality. She loves seeing that "ah-ha" moment in peoples eyes in her sessions and workshops. She lives in Houston, Texas, but enjoys all the travel for client work and speaking gigs.

0 0 votes
Article Rating
Subscribe
Notify of
4 Comments
Oldest
Newest
Inline Feedbacks
View all comments
asia
12 years ago

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
12 years ago
Reply to  Acha Vincent

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 [url=http://ostraining.com]ostraining.com[/url], please log into the support forum ([url=http://www.ostraining.com/support-forum/)]http://www.ostraining.com/s…[/url] 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 [url=http://www.ostraining.com/online]www.ostraining.com/online[/url]

Kind regards,

Nick

MARIO
MARIO
11 years ago

for transfer your localhost to godaddy, is different

the hostname is like yourdatabase.db.7774631.hostedresource. in yoyr db_url

see this help page: [url=http://support.godaddy.com/help/article/3440/what-is-the-url-for-the-database-publishing-service]http://support.godaddy.com/…[/url]

no changes for base_url

Rob Rohena
Rob Rohena
5 years ago

Can you still move your drupal site without the old database?

4
0
Would love your thoughts, please comment.x
()
x