How to Transfer a WordPress Blog to a new Server or Web Hosting
I have been seeing many queries and requests about transfer / migration of a WordPress blog installation from one server to another server or web hosting account from different webmasters.
There is an increasing demand for a dependable and detailed tutorial for the same. Hence I decided to create a detailed tutorial with screenshots and steps that will clearly explain on how to migrate an already established WordPress blog to a different web hosting server without any issues.
Tutorial Legend:
- OLDserver – The server on which the blog is already installed on.
- NEWserver – The destination server of the new target web hosting company.
- OLDdatabase – The database file of the original blog.
- NEWdatabase – The database of the target blog.
A High level view of the procedure:
- Backup the FTP files and folders to your local machine from the OLDserver.
- Take a backup of the WordPress Database to your local machine from the OLDserver.
- Create a new Database on the NEWserver
- Import the OLDdatabase file to the freshly created NEWdatabase
- Update settings on the NEWdatabase.
- Upload the files and folder to the FTP of the NEWserver.
- Edit the Wp-config.php file to ensure database and user details are correct.
- Change the Name server of the domain to the new hosting.
- Test your website features.
STEP 1: Download the Files and Folders from your FTP to your local computer
You could either use a FTP client like FileZilla or directly download the Files and folder of your WordPress blog installation to your local computer. Please note that you should be downloading all the files, folders and the entire content of the folder where your “WordPress blog installation” resides in.
STEP 2: Download the original database from the OLDserver
This is the second step wherein you should download or export the OLDdatabase file to your local computer. Once you are logged in the OLDserver control panel, locate the phpMyadmin icon and click on it.
Click on the database that we need to export / download on to the local machine as show in the image and further click on the “Export” tab on the right hand side as show in the next screenshot.
Settings for database export: The below boxes needs to remain checked as shown in the screenshot. Once the settings are all fine, enter a name for the export file (any name of your choice) and please click on the “Go” button to proceed for the export. Save the file.
Great! Now you are done with everything you need from the OLDserver. Good job!
STEP 3: Import the FTP files to the NEWserver
This should be an easy task for you, upload all the files through your FTP client or webhosting control panel of your NEWserver and make sure the size of the backup and the migrated files are matching.
Step 4: Import the Database to your NEWserver
To start off, we will have to first create a new database, new database user and assign privileges on the NEWserver. This task is divided as below:
- Create fresh database on the NEWserver
- Create new database user on the NEWserver
- Assign “All privileges” for the new DB user on the NEWdatabase created.
- Import the OLDdatabase to the NEWdatabase.
Create the Fresh database on the NEWserver from the control panel and follow the below screenshots to create a new user and further assign the privileges to the new user created for the database access as shown in the images above. Also take a note of the new database name and new database user name to use later.
Importing the OLDdatabase into the freshly created one
Again access the phpMyadmin on the NEWserver and select the fresh created database and proceed to the “Import” tab as shown in the image and simply import the old database to the new one. This might take some time depending on the size of your database.
Once your database file is imported, it will give a confirmation message saying “N number of queries successfully executed”
Important change to make after importing the OLDdatabase to the NEWdatabase
You would need to make 3 checks as show in the screenshot and edit the WP_Options table value to the correct one. Here most case you would only need to edit the Upload_Path value as it will change with the change of host.
Only field you need to replace from what is shown in the screenshot is – replace “usedms4n” with your Cpanel login name or database name prefix that is auto created.
Now before we call if completed, Final Step: Browse to your WordPress blog folder and edit “WP-config.php” file and make change the database name, database username, database password to the freshly created database and users.
Good Job! Now you are done with the database and File import. If you haven’t yet redirected your domain name server to the new webhosting name server, do that now and your migration is complete. Test all the features to find make sure it works great.
Feel free to drop a comment with your question and I will try my best to help you out resolving your issues.
Very detailed tutorial indeed!
Thanks for sharing this – I was searching for a detailed tutorial for migration of one of my blogs and have already tried applications like backup buddy and WP twin to clone that website to different location but all fails due to the size of the database, do you think is it possible to migrate a blog with file size of 130MB +
Thanks again
Seleema
Thanks Seleema for the kind words.
Yes, With this method of manual backup and transfer you can do a migration of any size. It is the method followed by industry experts, so no worry.
PS: remember to keep your backup safe.
Cheers
Josh
This is what is called a true tutorial! Hats off to you man. Thanks for posting a detailed tutorial.
I was waiting to complete my migration to comment on this. will await more such tutorials from your side.
regards
Anil
Thanks for the Kind words Anil!
Stay tuned..
Cheers
Josh
I change the url by opening the sql in a text editor and using the find and replace funtion just in case there is any hard coded urls in the database.
Dear Ragab,
Yes, Thats not a bad idea either. But that step becomes vital when you are changing the web host as well as the Domain. When you are only migrating the web hosting keeping the domain name same, the above steps are more than enough for perfect transition.
warm regards
Josh
Thanks for this tip, was handy as I do develop sometimes under a test server/test domain name and by using TextEditor I did the find replace all and took out the hard coded urls that was produced from creating links in the pages within WordPress.
Great tutorial thanks very much. I love wordpress as a blogging platform but I always depended on wordpress blog hosting that came with it pre-installed. Now I just have to follow your instructions and do server migrations myself 😀
Hey Jenkins,
Choosing a good webhost is one of the most critical part of starting a website. Great that you have found a good host and if you have discovered a better host, this tutorial always comes handy!
Cheers
Josh
Dear Josh,
Firstly, Great tutorial and well explained.
I have a question for you. What if the database you are planning to export is of very huge size, for example 200 MB, in that case the phpMYadmin would time out and not successfully export the database file.
How can I tackle this situation and completely download when I am on a shared web hosting.
regards
Bob
Hey Bob,
Thanks for the kind words buddy.
The method I adopt when there is a requirement to export huge database is by setting a backup rule for my database through the control panel to dump the database to FTP once a week and then simply download it from your FTP through Filezilla. I guess that should fix your issue right..
Cheers
Josh
I also want to change my hosting company . I have done every thing . but when I was uploading my .sql file to new server . It i showing me error . sql file is asking for the old data base till now . why i am facing this
Dear Fayaz,
Please clarify how are you trying to import the database file, is it through the phpMYadmin interface.
Also clarify the size of the database file and the exact error message.
regards
Josh
thank you so much for this tutorial this is really great to many reader gonna like this article..lot of ideas and tips in how to transfer WP in a new server…cool
Hey Formica,
Glad you enjoyed the post!
regards, Josh
Wow this new, great tutorial i didn't know about this to transfer WP blog into new server…. this article is very interesting….Now i have a new tips for my blog…..thanks for the share…
Transfer blog into new server, This is new tips. I didn't know that my blog can make like this, this very cool info.
I thought I've made a lot for my blogs, updating a video,putting some cool gadget to make my blog to make it cool. I made also many techniques to get high traffic…But this blog have a different story and idea, How to Transfer a WordPress Blog to a new Server. Wow that sounds cool and great, i really don't know about this matter.. I will try this tips thanks for this tips…
Very great indeed tutorial,Thanks for sharing this – this is my very cool tips that I've seen i really don't imagine if what happen after i use this techniques to my blogs. i tell you frankly I'm really new of this transferring my blog in new server….
WOW what a great tutorial been strugling with that myself thanks again josh
Nice!! Thank You for this tutorial 🙂
Thanks a lot for this. I had to change servers for my website (12vid.com) a couple of months ago and it took me so much time, stress and many problems. I could really use this back then and I will surely use it if I'll need it in the future.
Great work!
Much appreciated.
Thnaks for new tutorial, it is very useful,
thanks again….
Thank you for this, I am using this guide to migrate my wordpress. Completed except haven't yet configure the domain, let't see in minutes.
Thanks for your tutorial, followed your instructions and worked a treat.
Excellent blog here! Also your site quite a bit up fast! What web host are you the usage of? Can I am getting your associate hyperlink for your host? I wish my site loaded up as fast as yours lol
Thanks for yor tutorial, try to follow the instruction. It solve my problem now,
Thanks for sharing. It's also important to choose a good hosting company with good support. 🙂 Followed your advice, it works!
Dear Smartsite,
Glad that it worked for you and others.
Stay tuned for more and do ask in case of any queries.
regards, Josh
Классный материал и очень нужный.. Непременно им воспользуюсь. Спасибо.
Может быть Вам будет интересна возможность создания пассивного дохода.
I too had some problems with my webhost and decided to move to a better one. And I hired a tech guy to do it for me. Not that I don't know my IT stuff, but because I could not afford to lose my Adsense blogs…