If you are a self hosted blogger for long, I’m sure you must have get into a situation where you have to migrate WordPress hosting many times. Personally, this blog ShoutMeLoud has been migrated many times from Dreamhost > Hostgator > Knownhost > Linode > Hostgator. Yah, in 3 year tenure of this Wp blog, that’a quite a change of Webhosting. Some, Webhosting offer dedicated support for migration of your Webhosting account and some of them wants you to work on this technical side.
Here at ShoutMeLoud we offer Blog migration service, but if you are good with technical know how, it doesn’t harm to learn Webhosting migration your self. It’s one time learning process, and if you get it right, in future migration hosts will be like snapping your fingers.
We earlier shared a post on How to migrate from Blogger to WordPress with 301 Redirection. This time I will be telling you how to migrate your web-hosting and Domain with 301 redirection without leaving traffic behind. This post is useful for those who want to migrate from one hosting to another (List of Recommended Web-hosts) and also for those who made a mistake while registering a domain so they can redirect traffic from their old domain to the new one.
Well, I am sharing this post because I started with a free .co.cc domain and a free hosting from 000webhost.com. As the time passed, I came to know the advantages of Top Level Domains and paid hosting. That’s why I migrated my web-hosting to a paid one and changed my domain from havefunforever.co.cc to havefunforever.com.
Step by Step guide to migrate WordPress Hosting
There are many methods which you can use to change your hosting. If your existing host offers cPanel, this will be super easy. But for the tutorial sake, lets make it generic for every Webhosting company. When ever you shop for a new host, always look for latest cPanel, FTP support and WordPress compatibility. If you not sure, which webhosting to go for, check our WordPress webhosting recommendation.
1. Connect to your old Web-host using any Ftp client like Filezilla and download all the files in public_html folder.
2. Open your MySQL database using phpMyAdmin and download the database.
3. Open your new Web-host’s file manager and upload the files to public_html folder you download in 1st step.
[Note] If you are using Dropbox as CDN, then you only need to transfer the .php files in wp-content & wp-includes folder to the new hosting.
- Also Read: How to Use Dropbox as CDN for WordPress
4. [If changing Domain] Open wp-config.php file and add the following code in it. Replace example.com with your new domain.
5. Create a new MySQL database and import the MySQL file using the import tab.
How to set up 301 Redirection for Domain Name Change:
6. [If changing Domain] Open your Old Web-host’s file manager and in the public_html directory, create a new file named .htaccess and the following code in it. (Replace example.com with your new domain name)
Redirect 301 / http://www.example.com/
[Note] Yes, you can delete all the files from you old blog except the .htaccess file. To save money, you can also host your old domain on the new hosting so you don’t have to pay for the old one.
7. Everything is done. Just visit your old blog and check if it’s redirecting to the new blog or not.
Before you change your Name server, I suggest you to edit your hosts file to verify if everything is working fine or not. If yes, change your name server to point to new hosting account.
I hope this step by step guide will help you to migrate your Webhost without any technical hassle, but if you are still stuck, feel free to let us know via comment.