
Migrating a Joomla Website to New Hosting When it Uses Admin Tools and Sh404SEF
A lot of people seem to have continual problems with this one. Let me set the scene.
- You wanted to change hosting providers.
- You moved your files and database over to your new hosting.
- You tried to access your migrated website using the temporary URL given to you by your new hosting company, and….. oh. Bother. Server 500 errors galore, or the page doesn’t load, or a host of other “funnies”, which are decidedly unfunny.
If you’re using Akeeba’s Admin Tools and/or Sh404SEF, here some nice little tips to help make everything a little smoother.
So first off, the majority of your problems are likely to be htaccess file related, so you’ll need access to these babies (yes, plural – read on).
You got htaccess access? Ok, let’s dive in.
The below assumes that you’ve already exported your database from your old hosting and imported it into your new hosting, and transferred all your files over from your old hosting to your new hosting.
- Log into the FTP where your transferred files now live (on your new hosting).
- BACK UP ANY FILES THAT YOU CHANGE BEFORE YOU CHANGE THEM. I will now refrain from CAPS, and yes you should read the above sentence as if someone were shouting at you. Backup backup backup. Moving on.
- Update your configuration.php file, which can be found in the public_html root folder of your Joomla website files. Update db name, db username, db pw, temp and log directory file locations. Also make sure that the live_site entry is empty (i.e. just public $live_site = ”; ). The live_site change is only temporary (for testing purposes), so you’ll need to revert this back to its original setting after your testing is finished.
- Go to /public_html/administrator on your new hosting and open the htaccess file there. Update this file to replace the old cpanel account name with your new cpanel account name.
- Go to the root of your public_html folder and open the htaccess file there. Edit the following htaccess lines and save the file:
Change RewriteBase / to RewriteBase /~abcdef/ . Put the new cpanel username or the numbers/letters defined by your temporary URL instead of abcdef. OR, if you only have an IP address, then this should be left as RewriteBase / .
RewriteRule ^index\.php$ http%2://blah.tempurl.com/~abcdef/ [R,L] (if applicable). Update the items in bold with the temporary URL for your new hosting.
Comment out the below two lines (if they exist) by putting a # in front of each line:
#RewriteCond %{HTTP_HOST} !^www\. [NC]
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R,L]If you are still having problems accessing the front end of your website, make sure you aren’t viewing a cached page by clearing your browser cache and/or checking your website in a different browser. Carry out all your testing, and when finished, undo all of the above htaccess changes (except for the admin htaccess change in point 4, which must remain) and save. Also, you’ll need to undo your live_site change in the configuration.php file and save.
- Update the nameservers to point to the new hosting.
- Re-create the old hosting email accounts and forwards on the new hosting, log into cPanel on your new hosting and set -> MX entry -> LOCAL Mail Exchanger -> Save.
- Go to cPanel on old hosting -> MX entry -> REMOTE Mail Exchanger -> Save.
- Check for the next 3 days that there is no email left in the old hosting.
- You are done. Awesome work!