Last updated March 10, 2011. Created by joachim on November 9, 2005.
Edited by rmarescu, Wolfflow, AjK, cel4145. 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 Test Site Files
Using an FTP client such as SmartFTP, download all your existing test site files to your hard drive. The especially important files to keep track of are settings.php, and .htaccess.
II. Change settings.php in your test site Drupal files
Open and edit the file located under sites/default/settings.php (or includes/conf.php) with a plain text editor such as jEdit. Follow the directions in the file and modify this setting:
$base_url = 'http://www.example.com/';
(This is the address where you will upload 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.
III. Upload the test site Drupal files to your live site directory
Using an FTP client such as SmartFTP,
- Download all your live site files to a backup folder on your desktop.
- Delete all your live site files on your server. You made a backup, right?
- Upload all the test site files to the directory:
http://www.example.com/In FTP world this is usually seen as "public_html/" or "www/".
IV. Check if your test site works
Navigate to http://www.example.com/ and you should see your newly upgraded Drupal site.
Some more suggestions:
- .htaccess may need to be changed too
If you uncommented the following line in your .htaccess file in order to get rewrite rules to work properly with a subdirectory for your test site, you may need to re-comment it.
from:
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
RewriteBase /drupalto:
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
# RewriteBase /drupalNote:
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!
Comments
Copying over user uploaded files
1. Copy the user uploaded files from your File System directory to the corresponding directory of your destination site.
2. Update the configuration at administer > Site Configuration > File system.
3. If you have a destination file upload directory path different than the source (usually in case of multisite you may have a site specific upload directory eg:
<path/sitename/environment>/files), run the following SQL on your destination database's files table:update files set filepath = (select replace(filepath,<srcpath>,<destination path>));This is required for correcting download urls of the user uploaded files.