Thursday, January 29, 2009

How to Move Your Joomla! Site to a New Server

Why not use a fresh install?

In my case, I probably could have. I only had about 4 or 5 articles on the test site, and I am using relatively few 3rd party CMT's (JomComment, TagBot, and JoomlaXplorer). But, I decided it would be easier just to move the installation I had to the new server, so I did.

You will want to move your Joomla! installation rather than re-install if you fit one or all of the following parameters:
Your site has accumulated a large amount of data in the database over time (sections, categories, content items, contacts, newsfeeds, etc.).
Your site uses multiple 3rd-part extensions already configured and/or customized for your site.

You just feel like trying it out to see if you can do it.

Step 1: Backup everything!
The first thing you want to do is backup all files within your Joomla! installation. Create a folder on your local system, and download all files to that folder using your ftp client application. I used FileZilla as my ftp client application to download all of my files to a folder on my desktop I named "howtojoomla".

Step 2: Export your database
Note: For this step, it really helps if you have phpMyAdmin installed on your server. Most hosting companies have phpMyAdmin already installed. If you are unsure, ask your hosting provider.

The second thing you need to do is export your Joomla! database. The best thing to do is to export it into an SQL file, which makes importing it easier in a later step. An SQL file will contain all of the necessary SQL commands for creating your database tables and filling them with your data. Be sure you export the entire database.

Step 3: Modify configuration.php
This step is very important. Go to the folder on your local system to which you downloaded all of your Joomla! files. In the first level folder, you will find the file named "configuration.php". Open this file with a text editor and make the necessary changes. At the very least, you will probably need to change the following parameters:
$mosConfig_absolute_path: This is the absolute server path to your new Joomla! installation. It will probably look something like "/path/to/joomla/installation".
$mosConfig_cachepath: This is the absolute server path to the cache for your Joomla! installation. It will probably look something like "/path/to/joomla/installation/cache".
$mosConfig_live_site: This is your website's url. It will be something like "http://www.yoursite.com".
$mosConfig_host: This is the location of the server that hosts your MySQL database. For most instances, this value will be "localhost". If you are unsure, ask your hosting provider.
$mosConfig_db: This is the name of your MySQL database.
$mosConfig_user: This is the database user name. Make sure this user has all privileges on your database.
$mosConfig_password: This is the password for your MySQL database user.

Step 4: Upload all of your files to your new server
Using an ftp client application (like FileZilla), upload all of your files to the location on your new server where you want to install Joomla!.

Step 5: Import your database to your new MySQL server
Using phpMyAdmin (or console commands if you are an advanced database administrator) and the SQL file you generated in step 2, import your old database into your new database.

Step 6: Test your new installation
Your move should now be complete, but please don't take my word for it. Test your site to make sure that everything is in it's proper place and working the way you expect it to. For example, if you did not use relative url's for your links on your old site, they will not work properly on your new site.

Read More...

No comments: