Last updated June 20, 2009. Created on November 9, 2005.
Edited by bryan kennedy, AjK, cel4145, Amazon. Log in to edit this page.

TIP: Make sure your test site is a recent copy of your live site, otherwise you will lose changes. It might be a good idea to create a new test site if it has been a while.

I. Backup Your Drupal Files
Copy the contents of your live site directory to a 'backup' directory, in case something goes wrong.

cp live_site/.htaccess backup/.

Make sure the .htaccess file gets copied to the 'backup' directory as well.

Once you have copied your test site to your live site and are using your test database as your live database, make sure that you create a new test copy of your live database when you create a new test site!

Do not use your live database with your test site or you risk corrupting and losing your live data!

II. Copy your test site files to your live site directory

  1. Delete all your live site files with the Unix 'rm' command. You made a backup, right?
  2. Copy the contents of your test site directory to your live site directory

    cp test_site/.htaccess live_site/.

Make sure the .htaccess file gets copied to the test_site directory as well.

III. Change settings.php in your live site Drupal files
Open and edit the file located under live_site/sites/default/settings.php with a plain text editor such as jEdit. Follow the directions in the file and modify this setting:

$base_url = '';

(This is the address of your live site directory. This tells Drupal where to look for the Drupal files to connect with.)

There is no need to change the database settings. Just take note that your test site database is now being used as the live site database.

IV. Check if your live site works
Navigate to and you should see your newly upgraded live site.

Looking for support? Visit the forums, or join #drupal-support in IRC.


webmaster65201’s picture

I tried this and it didn't work. I used my godaddy editor instead of Jedit. I'm assuming it should do the same thing but, it will not save the settings.php file. Any help would be great. I've been working on this for quite some time.

brett1’s picture

you need to change the permissions on the settings file to 777,
once you have made your changes, change it back to (644)
the command line is
chmod 777 settings.php
else in filezilla you cna write click and change the permissions -
in filezilla it only remains on 777 for a short time

The method described above works for most sites but I'm struggling
with one of my sites and I have done the what is documented....

I think I need to run a script through my database to change the url references,
I did this once before with great results, now if I could just remember how

--- ok - update I found the script, I thought I would place it here for the brave
(backup before attempting this)

This worked nicely for me in the past, about to try it again, wish me luck