Menu

Joomla Blog

Tutorials, reviews, case studies and other tips to help website owners and website developers master the Joomla content management system.

Move a Joomla installation to a new folder using cPanel

Move a Joomla installation to a new folder using cPanel

If you have chosen to build your Joomla website inside a sub-folder of an existing hosting account, you might be unsure of the easiest way to replace the old site with your new one. There are a few ways you can do this, but in this tutorial, I’ll show you how to achieve this using your hosting control panel. I’m using cPanel, but the principles apply with other control panels, as long as they include a file manager as you’ll see shortly.

This video is best viewed at full screen:



Step 1 - Backup everything. If you mess this up and you don’t have a backup, you could lose both your new site and your old one! You can do this using the cPanel backup feature.

Step 2 - Login to your control panel and go to the File Manager.

Step 3 - Navigate to the folder that contains your web files which in cPanel is public_html. Your current website files are displayed along with the folder that contains the Joomla website.

Step 4 - Click the New Folder button and enter a name like old.

Step 5 - Click the Select all button above the listing. But then deselect the folder containing your Joomla installation and deselect the new folder you created in the previous step. You do this by holding the Ctrl key on Windows or Command key on a Mac and clicking each folder.

Step 6 - Click the Compress button. This opens a new window. Choose the first option - Zip Archive. Then in the address box, insert the name of the new folder after public_html and give the zip file a helpful name such as archive.zip. So in this example, the full path is /public_html/old/archive.zip
Then click the Compress file button. This compresses all of your old website files and stores them as a zip file in the folder you created in step 4. When this process is complete, you might like to navigate to this folder and confirm that the zip file was created correctly. Right-click on the file name and choose View to check the contents of the zip file.

Step 7 - Return to the main folder if necessary and then Select All. Once again, make sure you deselect the joomla folder as well as the archive folder you created.

Step 8 - Click the Delete button and then confirm the delete action. As long as you do this properly, this step will just delete the current live site files.

Step 9 - Navigate to the joomla folder. Select all and click the Move File button. In the path box, remove the folder name so it just reads public_html. Then click Move Files. When complete, navigate to the main folder again and check that the Joomla files are there.

Step 10 - Select configuration.php and click the Code Editor button. Scroll down towards the bottom and find the line starting with public $log_path. At the end of this line you’ll probably find that the name of the previous development folder is included. Remove this so it reads public_html/logs. Do the same on the next line so the line ends with public_html/tmp. Click the Save Changes button towards the top right.

Now open a new browser tab and go to your web address. With any luck, all will be fine, but check all pages, especially any images and links.

If something does go wrong, you can move the Joomla files back to where they were, move the archive file into the main directory and use the Extract button to return things to the way they were while you try to troubleshoot the problem. If you do have problems, the quickest solution might be to simply try making a backup of the Joomla site using Akeeba Backup and restore it into the main folder using Akeeba Kickstart. This is demonstrated in our Beyond the Basics series. But before you do that, there are a couple of things to check. Go back to the configuration.php file and ensure that there is nothing entered in the line starting with var livesite. If there is, make sure the previous folder name is not present. Another place to check is the .htaccess file. If you entered something next to the RewriteBase line, comment this out by inserting a hash at the beginning of the line.

And that’s how you move a Joomla site from a sub-folder to the main folder using cPanel.

Rate this blog entry:
YooTheme Updates Icon Set
What You Need to Know About Joomla 3

Related Posts

 

Comments 15

Guest - Michael on Thursday, 09 August 2012 04:54

Well Richard, you saved me again. I had tried Akeeba to move a site in place of the live one and got a mysterious error in Akeeba it could not continue. Akeeba forums did not help, so I figured I was in for another late night.

Then I saw this post. I tried it in readiness for the move. Worked like a as you said.

Thanks for featuring my post on starting a new career on your new site :-)

Michael

1
Well Richard, you saved me again. I had tried Akeeba to move a site in place of the live one and got a mysterious error in Akeeba it could not continue. Akeeba forums did not help, so I figured I was in for another late night. Then I saw this post. I tried it in readiness for the move. Worked like a as you said. Thanks for featuring my post on starting a new career on your new site :-) Michael
Guest - Paul DiBenedetto on Thursday, 09 August 2012 06:45

Follow-up question. Is this also hoow would you handle moving a Joomla site developed in a sub-directory under one URL but moving it to a different URL?

0
Follow-up question. Is this also hoow would you handle moving a Joomla site developed in a sub-directory under one URL but moving it to a different URL?
Richard Pearce on Thursday, 09 August 2012 07:16

If the other site is within the same hosting account - i.e. you can access both site folders through the same File Manager - then yes you could use this method. If not, you need to backup account 1 using Akeeba Backup and restore it to account 2 using Akeeba Kickstart.

0
If the other site is within the same hosting account - i.e. you can access both site folders through the same File Manager - then yes you could use this method. If not, you need to backup account 1 using Akeeba Backup and restore it to account 2 using Akeeba Kickstart.
Tom Deighton on Friday, 10 August 2012 20:58

Thank You Richard. Nice job! Moving Joomla makes my head fuzzy. I have stories I can tell ... I'll wait for Halloween though.

I did recently use akeeba backup and kickstart to move (read "copy") a Joomla 2.5 from a web server to a wamp. It was almost seamless. The moved site wouldn't work on the wamp until I disabled a particular module (rokweather). In other words the backend worked fine but the front threw an error...till I disabled the module.

Thanks again, Man. Keep up the good work.
Tom

0
Thank You Richard. Nice job! Moving Joomla makes my head fuzzy. I have stories I can tell ... I'll wait for Halloween though. I did recently use akeeba backup and kickstart to move (read "copy") a Joomla 2.5 from a web server to a wamp. It was almost seamless. The moved site wouldn't work on the wamp until I disabled a particular module (rokweather). In other words the backend worked fine but the front threw an error...till I disabled the module. Thanks again, Man. Keep up the good work. Tom
Guest - Trooper on Saturday, 11 August 2012 06:23

Why waste your time doing it manually when free tools like Akeeba Backup simplify the entire process...nice to see an alternative but your way is clunky and prone to user error. I have been using Akeeba for over 2 years now and never had a problem.

0
Why waste your time doing it manually when free tools like Akeeba Backup simplify the entire process...nice to see an alternative but your way is clunky and prone to user error. I have been using Akeeba for over 2 years now and never had a problem.
Guest - Ryan Miller on Tuesday, 02 December 2014 05:03

This was hardly a waste of time. I made a back-up just incase, but I didn't even need to. Following these steps took me 5 minutes and I can now do this in 1 minute now that I understand the process, thanks to this article. Thanks again!

0
This was hardly a waste of time. I made a back-up just incase, but I didn't even need to. Following these steps took me 5 minutes and I can now do this in 1 minute now that I understand the process, thanks to this article. Thanks again!
Richard Pearce on Saturday, 11 August 2012 10:31

This method saves time. We love, use and recommend Akeeba all the time. But this method is faster than creating the backup (although admittedly you should perform a backup), downloading the backup, uploading the backup, and going through the installation process again. Depending on the size of the site, this can take a long time, and the website will be offline during the process.

No, it's not for everyone.

0
This method saves time. We love, use and recommend Akeeba all the time. But this method is faster than creating the backup (although admittedly you should perform a backup), downloading the backup, uploading the backup, and going through the installation process again. Depending on the size of the site, this can take a long time, and the website will be offline during the process. No, it's not for everyone.
Tom Deighton on Saturday, 11 August 2012 11:23

I’m in the good position of agreeing with both of you. After using Akeeba backup and kick start one time I think I will make it routine to back up my sites.
Now once you learn to use a module like Akeeba backup, you’ve learned to use a particular vendor’s module.
When you take a backup like the video demonstrates you learn something about how to work with your web server. Working with the web server at the nut and bolts level will always serve you. (OK, I know it’s not real “nuts and bolts” server stuff but I loved the File Manager lesson)

0
I’m in the good position of agreeing with both of you. After using Akeeba backup and kick start one time I think I will make it routine to back up my sites. Now once you learn to use a module like Akeeba backup, you’ve learned to use a particular vendor’s module. When you take a backup like the video demonstrates you learn something about how to work with your web server. Working with the web server at the nut and bolts level will always serve you. (OK, I know it’s not real “nuts and bolts” server stuff but I loved the File Manager lesson)
Guest - Anne on Friday, 18 January 2013 20:19

Richard, thank you for all your efforts. Your work has been very helpful to me.

One area I'm unclear about is the database files. I'm always uncertain with Akeeba Backup, and you don't mention them at all. If you are moving the site, they would remain the same, right? Are they located in this file structure?

But, if you are basically "copying" the site (say to test an upgrade), you need to create new database files, correct?

If you could help clear this issue up for me, that would be great!

Thanks!

0
Richard, thank you for all your efforts. Your work has been very helpful to me. One area I'm unclear about is the database files. I'm always uncertain with Akeeba Backup, and you don't mention them at all. If you are moving the site, they would remain the same, right? Are they located in this file structure? But, if you are basically "copying" the site (say to test an upgrade), you need to create new database files, correct? If you could help clear this issue up for me, that would be great! Thanks!
Robert Wilson on Saturday, 19 January 2013 04:10

Hi Anne,

Akeeba is mentioned above, but we've covered it pretty extensively in Beyond the Basics, so this is just another method to try.

When you move (or restore) a site with Akeeba Backup all of the files, directories and everything are identical. You are right, you do need to create a new database and database user to restore the site back into. Hope that makes sense.

0
Hi Anne, Akeeba is mentioned above, but we've covered it pretty extensively in Beyond the Basics, so this is just another method to try. When you move (or restore) a site with Akeeba Backup all of the files, directories and everything are identical. You are right, you do need to create a new database and database user to restore the site back into. Hope that makes sense.
Blake Burroughs on Thursday, 16 May 2013 06:06

Richard--- Glad I stumbled upon this. I will need it soon!

0
Richard--- Glad I stumbled upon this. I will need it soon!
thezone on Tuesday, 19 November 2013 13:09

OMG, OMG.. Brilliant! This works so well!
So Easy.
Well, I moved the site from one directory to another on the same machine.
It worked.
Note, I did not move it from one machine to another.Thanks

0
OMG, OMG.. Brilliant! This works so well! So Easy. Well, I moved the site from one directory to another on the same machine. It worked. Note, I did not move it from one machine to another.Thanks
Jessica on Tuesday, 07 January 2014 07:44

Will this work if my folder (new website) currently sits outside of public_html and is located in Home (same place as public_html file).

Could I simply drag and drop it into public_html and then follow the steps in your tutorial?

0
Will this work if my folder (new website) currently sits outside of public_html and is located in Home (same place as public_html file). Could I simply drag and drop it into public_html and then follow the steps in your tutorial?
Richard Pearce on Tuesday, 14 January 2014 14:24

Can't see why not.

0
Can't see why not.
Ryan Miller on Tuesday, 02 December 2014 05:01

Thank you so much for this! Followed these steps and was able to do this in less than 10 minutes! Awesome article, will link to you as soon as I finish my website :)

0
Thank you so much for this! Followed these steps and was able to do this in less than 10 minutes! Awesome article, will link to you as soon as I finish my website :)

Free Joomla TutorialLearn Joomla for free with our 16 lesson, 2 hour course.

Get Started