Move Joomla to Root of Same Server: How to Transfer a Joomla Site to a Different Directory

When developing a a Joomla website for a client I usually build it in the sub directory of the old domain (ie domain.com/newsite). When the site is completed I move it to the root of the domain (ie domain.com). Since many site owners and/or developers think this is complicated process I’ve outlined the steps below so you can do it yourself.

Steps to Move Joomla to Root of Same Server

Requirements

FTP software
FTP login information
mySQL Database
Access to cpanel
phpmyadmin

1. Move files from the server to your desktop

Using your favorite FTP software (ie Filezilla) grab the sub directory containing your site files and download them to your desktop. After downloading them check the structure is the same in both areas to make sure you downloadeded all the files correctly.

2. Upload files from computer to the root of the same server

Transfer the sub folder you just downloaded from your desktop to the root of your server. Usually this is the public_html folder. Check the structure again to make sure all the files got uploaded.

3. Export a copy of the database to your computer using phpmyadmin

Click on the phpmyadmin icon within cpanel. It will display all the databases on the server on the left side of the window. Select the database of your sub directory site. It will display all the tables within your database.

Select the Export tab and you’ll be prompted to save the file in text format or zipped format. If it’s a small database save it in textual format (ie joom.sql). If it’s a very large database save it as a zipped file (ie joom.zip)

Click “Go” to save the database to your computer. Usually I create a folder called “Backup” on my desktop so I can easily locate the exported file.

4. Create a new database

Before importing the database you just downloaded, create a new database on your server using cpanel. This will be an empty database for the root domain (domain.com)

Log in to cpanel — databases — MySQL databases to create a new database and username for your new website.

5. Import the copy of the old database into the new database

  • Go to phpMyAdmin
  • Click on the new database you created in the left-hand column
  • Select the “import” tab
  • Click the Browse button under “File to import”, then select the database file you previously downloaded to your computer
  • Click Go to import the database

6. Edit the configuration.php file

Open configuration.php file on your computer in notepad and fill in the database name, database user, database password, log_path, tmp_path. Save and upload this file to your server. It will replace (overwrite) the one that’s already there.

7. Check your website displays correctly

Enter your website address (domain.com) in your browser. You should now see an exact copy of the website you built in the sub directory. If you encounter errors they are usually associated with not uploading all the files correctly.

8. Delete the sub directory

Once you’re sure you have an exact copy on your main domain, delete the sub directory containing your old files so you don’t have any duplicate content.

******************
Transferring old database to new site using the same template

Recently I had to transfer all the content from an old site built in a sub folder (domain.com/old) and transfer it to the new site on domain.com where both used the same template.

To do this I:

  • Deleted all the tables on domain.com using phpmyadmin
  • Edited the configuration.php file on domain/.com/old by editing log_path, tmp_path
  • Saved and uploaded configuration.php to the root of the server for domain.com

By simply editing configuration.php to point the database on domain.com I was able to complete the transfer within a few minutes.

Related Articles

Moving Joomla among directories/subdirectories
Moving WordPress to a New Server Step by Step
How to Backup mySQL Database With phpMyAdmin
How to add a database to a website

Video
How to move a Joomla site from one folder to another on the same server (alternative method)

Comments

  1. Hi there, I want to subscribe for this weblog to take most recent updates, therefore where can i do it please
    assist.

  2. Fantastic stuff, I re-designed my website and the search rankings plummeted
    Move Joomla to Root of Same Server: How to Transfer a Joomla Site to a
    Different Directory – The newest addition to
    my RSS feed!

Leave a Reply to christian fiction books Cancel reply

*