BLOG

Moving a Joomla site to a different directory on the same server

Very often we have customers asking how to move a site installed in a subdirectory into the main web root. This could be the case if you are working on a new version of your site in a subdirectory like test or beta and once done you want to replace the main site with this. In terms of URLs, lets assume for this example that you have a site at http://yourdomain.com and a new version at http://yourdomain.com/tester, and now we want to move the tester directory so that it replaces the site at http://yourdomain.com.

  1. Login to your hosting control panel and click on the "File Manager" icon.

  2. Right click on the tester directory and select Move file.

    Move directory

  3. In the dialog box type in ../. This basically means: "move the directory to its parent folder".

    Move directory

  4. Now if you browse your account's home dir you will see the tester dir next to the public_html folder.

    Move directory

  5. Rename the public_html folder to public_html_old.

    Move directory

    Move directory

  6. Rename the tester folder to public_html. (Same process as above).

  7. Update filesystem paths in configuration.php. You will find this file in public_html. In this file locate the lines where the log_path and tmp_path are set. In this case we simply need to remove the "tester" bit from the path and save the file.

    Move directory

    Change from:

    var $log_path = '/home/sites/yourdomain.com/public_html/tester/logs';
    var $tmp_path = '/home/sites/yourdomain.com/public_html/tester/tmp';
    

    To:

    var $log_path = '/home/sites/yourdomain.com/public_html/logs';
    var $tmp_path = '/home/sites/yourdomain.com/public_html/tmp';