Welcome to Joomla!

John's tips to help you build a great, Joomla! powered website

How Do I Articles

How do I "move" a Joomla website from one folder to another?

This applies to Joomla 1.0.13 and 1.5
One question that is asked frequenly is, "How do I move a Joomla website?" 

Often times we want to develop our site at one location, and then "take it live" at another location.   This article will explore how to move a Joomla site from one folder to another folder on the same server.  If you want to move a Joomla site from one server to a different server, there's another article for that here.  <TO DO> 

 

 

Develop in one folder, then move to another 

Very often we will want to develop our website in one folder, and then when it is "done" (or at least done enough to show to others) we want to move the site to another folder.

For example, I developed a new version of this website at www.joomla7.com/new/ while the original site was still up and running at www.joomla7.com.  So, when I got the new site ready to go live (it is in no way "done!"), I needed to move it from the /new/ folder to the "root" folder on my webserver.

So, how exactly do you do that?

Step 1:  Make a Backup

The first step is to make a backup of your existing site.  Something may go wrong in the switch, and you will want to be able to go back to the old site quickly if you run into a problem that you can't resolve quickly.

There are several ways to do this.

One, you can use an FTP (File Transfer Protocol) program to copy the files from your webserver to your computer.   I use SmartFTP, a very nice FTP program (and free for personal use), and here are the steps:

First of all, "log" into your site via your FTP program.

Next find the folder where your site is installed, and do a "right click" and choose "Download."

ss_move_1.gif

ss_move_2.gif

You will be asked to specify a folder to save the files in (I'd suggest making a new one just for this).  Then, the program will begin the process of transferring all of the files from your current website to a folder on your computer (that's why it is called FTP - "File Transfer Protocol").   Depending on the number of files you have to transfer and speed of your internet connection, this may take several minutes.  

Now, once that is done, you have a copy of your existing website on your computer.

Step 2:  Make a copy of the "new" site. 

Now, repeat that process for your "new" site.  Transfer all of the files from the server to your own computer.  You will, of course, want to put these files in a different folder than you put the files of your old site.

Again, that will take a few minutes to do.  There are over 12,000 files that make up a standard Joomla installation, so it will take a while to transfer.

Step 3:  Transfer your "new" site to its final destination

Since we want to move this site to the root folder of the server, we'll use the FTP program to transfer the files of the "new" site to the root folder of the file server.

Now, this can be a bit tricky because you have to get the folders right.   Let me explain.

When you downloaded your site to a folder on your computer, it ended up in a folder called "new."  If you upload it like that, it will end up in a folder called "new" up on your file server.  But, the file server wants the site to be in "public_html" (or whatever it is called on your server).

So, you need to rename the folder on your computer that has your "new" site to "public_html" before uploading it to your other server.

Now, let's go back to the FTP program that is pointing at your website.

In the "top" folder of your hosting account, you will want to "upload" the "public_html" folder from your computer (that one that has your "new" site) so that it overwrites the "public_html" folder on your webserver.

Using SmartFTP, it would look like this:

ss_move_3.gif

 Note that I am not uploading to the public_htm folder ... I am uploading to the "top" folder of the domain.

Why is that?  Because, if I upload a folder called "public_html" to a folder called "public_html", I will end up with my website in folder called:  public_html/public_html.

So, be careful here!

Now, transfer all of the files of your "new" Joomla site to your file server.  It generally takes longer to "upload" files than it does to "download" files, so you may want to fix yourself a cup of coffee or tea at this point (depending on your internet connection speed).

Note:  The SmartFTP program has 2 upload / download options.  One is called "Direct" which transfers one file at a time.  Another is called "Queue" which can transfer more than 1 file at at time (like 4, 5, 6 ... whatever).  I usually use the "Queue" option and have mine set for  4 or 5 simultaneous transfers.  (Some servers limit you to 2 transfers at a time).

Step 4:  Change the configuration.php file

OK.  You have transferred your new site to the server, and you are almost done!

A Joomla website uses a plain text file named "configuration.php" to hold much of the information that it needs to operate properly.  In order for your site to work at its new location, we need to update a few of the items in your configuration file.

Move to the "root" folder of your website (the "public_html" folder) and find the file "configuration.php."  That is the file that we want to edit.

ss_move_4.gif

This will load the file in editing mode into your computer's text editor (or perhaps there is one built into your FTP program).

Note:  I have my FTP program to edit text files using the excellent (and free) PSPad (available from www.pspad.com ).  If you do much in Joomla, this is a great editor to have, and works great with SmartFTP.

There are 3 lines that you will need to change.

$mosconfig_live_site

$mosconfig_absolute_path

$mosconfig_cachepath 

Now, these settings will vary a bit depending on your hosting service, but generally you would set them up like this (using "www.mysite.com" as the example:

$mosconfig_live_site='http://www.mysite.com';

$mosconfig_absolute_path='/home/mysite/public_html';

$mosconfig_cachepath='/home/mysite/public_html/cache'; 

You must get these right!   Including the quote marks and the semi-colon at the end of the line.

Once you set these, save this file (and re-upload it to your server), and then give your new site a try.

Go to your site address in your browser (http://www.mysite.com) and you should see your site at the new location.

Congratulations!

The most common errors 

When I have done this and the site did not come up properly, it is often due to errors in my "configuration.php" file.  You changed 3 lines, remember.  Go back and ensure that you have changed those lines exactly right.  Perhaps you missed a semi-colon, or a quote, or mis-spelled a word.