Step-by-Step Guide to Migrate Your WordPress Site to a New Host
Are you ready to migrate your WordPress site and move to a new host or server? Moving your website to a new host can be a daunting and stressful experience, but it doesn’t need to be. Even though there are important steps to migrate your WordPress site if you follow our guide you can succeed.
Many people are faced with the need to move to a new host because of problems with their current provider and have just had enough. But all too often, migrating to a more reliable host is delayed time and again for fear of making a mistake and damaging your site(s).
To get around the problem, people will may pay a large fee for a professional to move their site for them. Or search for a new host that offers a migration service as part of a new hosting package. And then there are the people reading this article who take the third option of having a go at it themselves.
If you spend a little time preparing your own website, migrating is nothing to be concerned about. It can be a very straightforward project if approached correctly and can easily be reversed out of should any problems occur.
Let’s run through the steps required to move your WordPress website to a new host, but before we get started showing you how you can migrate your site, please keep in mind that many of the best WordPress hosting companies will actually move your site for you, so if you have just purchased a new hosting plan and are looking to move your site check with your new hosting provider first to see if they offer free migration.
Table of Contents
Quickly scroll down to any section or you can even bookmark any of the links below to make it easier to come back if you have to take a break during the process:
- Back up your website files
- Export The WordPress Database
- Create The WordPress Database On Your New Host Server
- Edit the wp-config.php File
- Import Your Database
- Upload The WordPress Files To Your New Host
- Defining New Domain & Search/Replace Old Domain
- Final Touches
Step 1: Backup Your Website Files
The very first step before migrating is to back up every aspect of your site. This should be a part of your general WordPress security, and is good practice before any major change. But it is also a requirement of migrating your WordPress installation since there is so much data being moved.
So how do you back up your site? There are plenty of plugins you can use to backup WordPress for you. With a backup plugin you typically install and then use built-in settings to manage which files get backed up, how often and where your backups are stored.
If you want to use a plugin, one of the best options is WPvivid. This plugin offers tons of powerful backup options for scheduling, restore points, limit files, filter large files, backup splitting, backup themes and plugins, remote storage compatibility, multisite support and more.
Alternatively you can take a more manual approach. To give you a quick summary, manual backups require a file transfer tool (FTP) in order to access your website files. Two popular FTP programs are FileZilla (PC) and Transmit (Mac). After installing you’ll need to use SFTP credential (from your web host account) to connect to your website’s server. Once you’ve connected select and download all files under your website’s directory. This includes the .htaccess file that is set to be hidden. Consult your FTP program’s help file to have it display hidden files if you are unable to see this file.
Depending on the number of media uploads you have in your site, this could take some time. While this download is underway we can begin step two and make a copy of your database.
Step 2: Export the WordPress Database
Exporting your database is a simple process that only requires a few steps to complete. Login to the cPanel account of your web server and open the phpMyAdmin application. Select the database that contains your WordPress installation from the list on the left hand sidebar and once selected click on the Export tab on the navigation menu.
The default settings of a Quick export and the SQL format for the export are sufficient for what we need. Click the Go button and the database export process will begin and a file will be downloaded to your local computer.
Once the database export and the FTP transfer of your files have both completed, you are ready to move onto the next stage.
Step 3: Create the WordPress Database on Your New Host Server
Before we can begin the migration to the new web host, we need to create an environment for a WordPress installation. To do this you must create a database that you can import your SQL data into.
Login to your new web host with the user credentials they have supplied you and connect to the cPanel software. For our guide we will be using the MySQL Databases application. If your web host doesn’t have that application running then you will should contact their support team to discover their method of creating new databases.
The steps to create a database are quite simple:
- Open MySQL Database and create a new database with an appropriate name for your website.
- Create a new MySQL user (with a secure password).
- Add this user account to the new database and grant it All Privileges.
Write down the database name, the new MySQL username and its password. You will need them soon.
Step 4: Edit the wp-config.php File
Browse to the folder on your local computer where you downloaded your website files to. In that folder there is a file called wp-config.php that controls the access between WordPress and your database.
Make a copy of this file and store it in another folder on your local computer. This is necessary for restoring the changes we are about to make should something go wrong later.
Open the original version of the file with your favorite text editor and make the following three changes:
1. Change the Database Name
Locate the following line:
define('DB_NAME', 'db_name');
The db_name portion of this line will currently be set to the MySQL database name of your old web host. This must be changed to the name of the new database you have just created.
2. Change the Database Username
Below this you will find the line:
define('DB_USER', 'db_user');
In this line you need to change the db_user portion from the username of your old host to match the new username you have just created.
3. Change the Database User Password
Finally, edit the third line:
define('DB_PASSWORD', 'db_pass');
As with the others the db_pass section of this line must be changed to the new secure password you created for your MySQL user.
Save wp-config.php and close the file.
Step 5: Import Your WordPress Database
Now that you have a new database to work with we can begin the import process.
Launch phpMyAdmin from the cPanel software on your new server and select your new database from the list on the left hands sidebar. Once it opens select the Import tab from the navigation menu.
In the File to Import section click the Choose File button and select the SQL file you exported previously.
Un-tick the Partial Import check box, make sure the format is set to SQL and then click the Go button. The database import will now begin.
The time this import takes varies depending on the size of your database. You should receive a message informing you of the success of the import when it has finished.
Step 6: Upload The WordPress Files To Your New Host
Now that you have the new database prepared and you’ve reconfigured the wp-config.php file, it is time to begin uploading your website’s files.
Connect to your new web host using your FTP program and browse to the folder that your website is going to be held. If this is the primary, or only site being installed on this web server then uploading the files to the public_html folder is the usual directory.
With the remote directory selected you can upload your website files that should now include the updated version of wp-config.php. As with the earlier download, this process can take some time.
Don’t delete these files from your local computer once the upload finishes. They are still needed until the final steps have been completed.
Step 7: Defining New Domain & Search/Replace Old Domain
If you are moving to a new/different domain then you should read over this step, if not, then you can skip this because you don’t have to update your site to point to a different domain.
One issue people always seem to have when moving their site is that they’ve added links to other posts on their site or inserted images directly by pointing to a URL on the server, causing these to break when moved over to a new domain. If you want to quickly and easily search for any instances of your old domain name and replace with the new name we suggest you take a look at the Search Replace DB script on github. This will allow you to do this with great ease. Just make sure you DELETE it when your are done (for security reasons) and don’t place it in your root domain, create a temp folder with a random name to host the script.
Changing Site URL: By doing a search and replace for the old domain and replacing with the new domain you’ll also be altering the site_url and home url values in the database (Changing the Site URL) which will ensure that when you try to log into your site on the new domain it doesn’t try and redirect you over to the old domain.
Step 8: Final Touches
This step actually includes two separate mini steps with (potentially) several days between them.
First – before you can use the site on your new host you will need to reconfigure your domain’s DNS settings. They will be set to point to your old host and you will need to point the correct records to the new server IP address.
This process will depend on where you have your domain registered. The details of completing this process are too varied to discuss in this post, but your domain registrar should have all of the details you need to make this change.
DNS changes can take up to 48 hours to fully propagate. It’s best to do this at a period when you expect lower levels of traffic. During this 48 hour window you should avoid making any changes to your website as you may be changing the old version of the site.
Second – after the 48-hour period has expired you should now be accessing the new web host when you go to your website. It’s at this point you can connect to your old web host to delete the files and database. You should still have a local backup copy of these files and the database export, along with the original wp-config.php file in case you need to roll back the migration. It can be a good idea to hold onto these files for a an extended period just to be on the safe side.
As you can see, when broken down into the above simple steps, the process isn’t that difficult. All it really requires is for you to be careful at each step and give yourself the option to go back to the original version until the last possible moment (in case of any problems).
Have you migrated your WordPress website recently? Let us know your experience with the process in the comments section below!
Nice summary Tom. I use Duplicator which does all this above. Although, with some themes I seem to loose the widget content and stuff, and specific theme settings. Still figuring out why?
Ugh, don’t ask me! The vagaries of site migration, etc. still confuse me to this day…you need to ask someone more intelligent than me 🙂
Hey Tom, thanks. very easy the way you put it. One final question. I am moving my site from a hosting domain to a addon domain. I see that there are several files outside the public_html (old domain) should I upload all the files or just the files inside the public_html.
Hi Jose,
You should backup everything, but you should only need to upload what’s inside the public_html folder, everything outside is “generally” just server related files unless you added something there. But like I said backup everything just incase 😉
A super easy way I found to duplicate a site? A plugin called NS Cloner – check it out here.
Tom maybe you could do a tutorial of that tool? I think your readers would find great value there.
We’ll definitely take a look! And we do regularly review plugins – if this is something you’d be interested in you can find our contact information on our contact page.
I tried Duplicator and it didn’t work out for me. I think the site was too big. Nearly 300 MB…
Yes probably ;(
It works like a charm. Thank you!
Thank you. I am about to move to new host too. First experience. >_<
Best of luck Emily!
Thanks, that’s what I thought. it worked wonderfully.
This is exactly what I’ve been looking for. Every time I develop something and then move it, I end up in all sorts of bother! Dude, sweet.
That’s awesome James!
Then I would advice you to look at the Duplicator plugin
The reason those settings don’t pass is because they are serialized data, you can learn more on this great article – http://wordpress.stackexchange.com/questions/9076/why-is-my-database-import-losing-text-widget-data
What AJ said 😉
Thanks for the info guys!!
No problem 🙂
Thanks a lot Tom, !! This was very helpful,now going to transfer my blog from JustHost to BlueHost. Thanks again 🙂
Thanks Deepak!
Tom, have never try to export before but i believe i should be able….. i created my site in a subdomain and now i want to transfer it to a fresh new domain i but for the site.DO i still need to do DNS or i can skip that stage
You only need to change DNS if you are changing servers or if your specific server requires a different IP address for each domain. I would recommend asking your webhost about this.
When did you switch from Justhost to Bluehost and why?
While migrating my clients websites widgets gets lost . I am not able to find out the solution for this problem.I am eager to know solution. Please reply if you know how migrate website without loosing widgets.
Widget options are saved as serialized data which can cause issues when trying to export them. Check out the answer here for a more detailed response – http://wordpress.stackexchange.com/questions/9076/why-is-my-database-import-losing-text-widget-data
I have migrated my site wpcares.com from hostmonster to bluehost. It is just great and easy. Can’t believe it that migrating a wordpress website is that easier with all the dynamic contents.
I’m glad your migration was easy and a success!
Sam, are you still with Bluehost? Would you recommend them or not? Why/why not?
I searched for ages and tried a few different techniques to transfer my wp site with no success, a lot of other sites steps were confusing.
Yours was easy to follow and my site worked on my new host straight away, thanks for the info!
This was SUPER helpful! Clear and precise. Thank you so much
Thank you so much! I sold my site on Flippa and had no idea how I will transfer the files..
This tutorial is amazing! 😀
Glad it was useful to you! Congrats on selling your site 😉
Thanks for a very clear explanation. The situation I’m in is slightly different (I think!). I already have a website that I designed in Dreamweaver and I want to use Wp instead. I’ve designed a site using Wp locally (using Xampp) and want to transfer these files to my existing host. If I delete all the existing files in the public_html folder at my existing host and follow the steps above (excluded the DNS redirect) will it work??
Hi Bill. I’m afraid I don’t quite understand what you are doing. Is your site coded in HTML? If so, you would have to manually add your content to a WordPress installation and then turn your HTML design into a WordPress theme that can be used with WordPress. You might want to hire someone to assist with this if you aren’t quite sure how to do so yourself, it might be worth it to make sure your data is safe!
Thank you very much for you prompt response, I really appreciate the help. Sorry I didn’t explain myself clearly. The situation is that I’ve designed a “new site”using Wp locally on my PC. My existing site (www.carrbridgegolf.com hosted by 123Connect)) is designed in HTML and I want to replace it with the “new site” designed in Wp. Is it as simple as deleting all the files in my public_html folder at 123Connect and uploading (using Ftp) the Wp site designed locally following your instructions?
Hey Bill, you probably already figured it all out by now! But yes, sounds like basically you just want to delete what’s live then upload the WP site. Don’t forget to make backups!
thanks for the great walkthrough.
Just thought I’d mention that I’m about to launch my new service at migrately.com which will help those folks who can’t or don’t want to move their site themselves.
The service will focus purely on moving WordPress websites from one host to another. Nothing more or less than that. It will also be priced competitively!
Launching soon, but there is a sign-up page at the above address where folks can register for more information.
Thanks again for the post!
Sounds cool. I signed up to get notified when its out.
Thanks, your guide worked perfectly for me. Just had some image library links to replace, but all plugins and widgets were totally fine. Cheers!
Short and simple
many thanks!!
Thankyou so much for such an amazing step by step guide. I just completed my webhost migration from 1and1 to godaddy and your article here was open all the time. It is very clear, detailed and easy to understand. Please keep this article ON for many many years because I am sure this guide will help lots of bloggers around the world in the webhost migration process. THANKS A LOT BUDDY!
That’s awesome Abdul! I’m glad this post was useful for you and that you were able to move your site without a hassle, good luck with your site!
AJ: I guess I have to be in the minority, things did not go so smoothly for me. I apologize in advance, but to fully explain, this will be a lengthy reply…
My WP site had the “Better WP Security” plugin installed and activated so it completely failed to come up properly on the new host after the import of the MySQL tables and data; and the ftp copy of the files. I had to start from scratch and (1) deactivate “Better WP Security” and remove following from the wp-config.php:
After deactivation of “Better WP Security” and removing above in wp-config.php, I then followed your steps again and had some success but something is still amiss. The site comes up perfectly fine for visitors to browse on the new host and with the new URL but, when I attempt to log in either through wp-admin or wp-login.php, it actually logs me back into the OLD WP site / location and not the new WP site / location.
Site was moved from mysite.net/WP on host “A” in a shared server hosting environment tomysite.net/WP on host “B” on a VPS host through same hosting company. When I go to mysite.net/WP/wp-admin (or mysite.net/WP/wp-login.php) everything appears to be fine (e.g. no redirection to old site has happened yet). But, when I enter my username and password, it logs me into my old site again @ mysite.net/WP/wp-admin.
I obviously cannot reactivate the security plugin, make any modifications to new site, and/or shut down the old site and redirect all traffic to new site until I am able to overcome & resolve this problem. Any suggestions / recommendations?
Regards
Terry
Hi Terry,
You probably need to update the site URL’s in the database still. I briefly added a note about this to Toms post under the heading “LINKING TO NEW URL”. Of course there are many ways of doing this, but this is the way I suggest.
Regarding the plugin issues…this is something that really can’t be added to the guide simply because there are so many plugins out there and each one works differently if we were to take plugins into consideration for the migration things would get way to long and complex.
Let me know if that bit about altering the URL in the DB helps. I think this is the step most people forget to do.
Edit: I moved my section up to step 7 because it’s really important 😉
Thank You Very Much Tom! I was trying to move my WP for almost 2 days and no success…after your step-by-step it’s done!!!!! At WordPress.Org the instructions do not mention nothing about import the DB and that’s why didn’t work before. So…I can’t thank you enough for your brilliant tutorial.
Glad that it helped you!
merci beaucoup pour cet article, sachant que j’ai beaucoup souffert afin de migrer mon site de localhost en hébergeur, je ne savais pas comment changer les liens localhost/page en site.com/page en utilisant les requêtes Sql.
Please read step #7 – “Step 7: Linking to New URL & Defining New Domain”
For guys that don’t much about this like me, you lost me in the first step. Where can I find a step by step that actually explains all the steps such as how to copy files from my web host? Many assume I know much more than I do 🙁
This is a very basic guide, if you are getting lost in the first step then you probably should consider hiring someone to do this for you. I noticed though your main site (if this is what you are moving) is hosted on WordPress.com so if you are moving this to your own self-hosted site the steps are quite different. Do a Google search for moving a WordPress.com site to a self-hosted WordPress installation and you should find some good stuff 😉
Thx! I followed your steps and everything is working.
I Just needed to update this string:
/** MySQL hostname */
define(‘DB_HOST’, ‘db_hostname’)
and delete a .membership file in the root of my new website (this file was created by my new hosting provider).
Thanks again! you rock!
Hi, what exactly did you change? I’m experiencing some permissions errors, thank you
URGENT HELP!
I had followed all above steps but when I checked my site it was Showing “Error establishing a database connection” though I changed the values of old db based wp-config.php to new db based values like db_name;db_user;db_pass;db_host;, I also imported that .SQL file using phpMyAdmin to new db. Also DNS has propagated, almost everything i had done! So please help me!
No No! Error is solved! It was mistake in db_password.
Thanks for replying to yourself – that turned out to be my problem, bad credentials.
**THANK YOU FOR THIS!! Saved me hours and money hiring someone.
Glad it helped Jason! You’re welcome!
Hi,
I’m very thankful for this wonderful tutorial.
Glad you liked it Waseem!
Sir, Help! Why my website is getting redirected to old host sometimes? Yes! It is working on new host but sometimes it gets redirected to the old host (error page)! Thank You in advance!
Are you sure your DNS is fully propagated? How long ago did you switch?
Hi
I want to know ur share this post plugin if it is possible
Thanks
It’s not a plugin, it’s something I coded for my site and added into my theme.
Just wanted to say thank you, I had tried to do it on my own, but I was missing editing the wp-config.php file. Thanks a lot
Easily the best and simplest guide to follow amongst the top ranking ones on google. Well done and thanks.
Appreciate it duke. Two thumbs up.
Thanks!
Kick Butt! I was able to move my wordpress to a new server with the help of this page
I wish I’d read this documentation before attempting a migration. It would have saved me a lot of hair! I can see from the steps here exactly where I went wrong. Next time I will follow this.
What if I do not have Cpanel on my new site ? Its on AWS.
I already have wordpress installed on my new AWS site and have downloaded the localhost.sql file from my esisting site.
You do not need CPanel, all you really need is FTP so you can download your content to move it over and access to PHPMyAdmin so you can export your database.
AJ, Thanks for the script suggestion. I downloaded if from githost and installed according to their directions, but I am getting this error in the “database” section: “Could not find driver”. It has the correct login and password, but doesn’t want to connect. Do you have any suggestions?
I’m not quite sure what that means. Have you tried Googling the error?
hello i just uploaded the compressed version of my website files to my new host and try to extract the files, the files were unable to extract. is it because the file format is in .rar as opposed to .zip
You might have to download a program/app that can extract the .rar.
Brilliant tutorial.Found it useful for my first migration.Thanks Tom
Glad it helped lakshmi! You’re welcome!
hello AJ clarks your tutorial helped me a lot in figuring out how i can move my website to a new host. But i still have issues when i moved the site to my new host, the host support agent asked me to configure an addon domain to my
for my site and point the nameservers to the new hosting name servers which i did and ask me to wait for 72hrs for the nameservers to fully propagate. this is the second day now my site is up now but when i click links i get 404 error. should i wait for my site for the 72 hours for my site to fully propagate? or should i download the search and replace DB script to change the URL. tanks
Depends. Did you move to a new server but keep the same domain name? If you are using the same domain name then there is no need to change the URL’s in the database because it will be the same. If you are changing the URL then yes you will have to make sure all URL’s point to the new one and not the old one.
Wow! I actually never thought I would be able to do this by myself, but I did!!!!!! I’m very thankful for this tutorial!
You’re welcom Sonja!
I recently converted an HTML site to WordPress after moving it to new servers at same WebHost and domain (they mostly did the second part). My problem is the links to documents i had set up from the old file structure that i had moved over were working, but it seems that once i started to upload files from within WordPress, those older links on the same page got broken! Does that make any sense? If this is off topic feel free to ignore, you just came up near top of Google results. I will continue to search for answers. Thanks!
Tom, thank you. That was a very helpful article.
You’re welcome. Glad you liked the post!
Well that was not hard.Hee
Glad it helped!
Tom, thanks so much for the breakdown! The ‘thought’ of doing this has held me back for so long. After reading through this guide I decided to give it a go. The result… AWESOME! So far so good, all is up and running. Just waiting on the final stages to adjust, name server changes.
The only thing I got stuck on which clearly passed with time was at Point 6. upload files. Not sure what I did or didn’t do correctly. It seems that when I copied the site files across there where a lot of these files already present from the MySQL database… Anyways… took a bit longer than I thought but all in all a successful transfer and pretty easy if you have no previous experience!
One strange thing that did happen, which we cannot work out how! In the wp-config.php file after the adjustments and transfer it had a strange ‘parse error’ this was due to the ‘ ‘ marks in the file. I did not change this at all, just the names within the area in between. The new hosting company found this issue and sorted it… they didn’t give me a reason why or how!
Thanks so much for this guide…AWESOME!
You’re welcome Paul! Glad your hosting company was a great help. 🙂
Thank you Tom!
If anyone have a problem to import the database via phpMyAdmin with this SQL message:
#1044 – Access denied for user ‘username’@’localhost’ to database ‘database_name’
and cannot does not have create new database’ privilege in phpMyAdmin, please see this guide: tipsandtricks-hq.com/how-to-import-wordpress-sql-database-backup-file-without-having-create-new-database-privileges-in-phpmyadmin-415
Thanks for the suggestion! 🙂
Thanks. This should be highlighted on the steps by Tom too. I was cracking my brains for a while
Well, this saved me time, effort and quite a bit of money. Thank you so much.
You’re welcome, Damian!
mmm great, thank you. Any ideas why I may be getting an internal server error?
There could be tons of reasons why, no way of knowing at all without looking into the server. Ask your webhost for some assistance, they should help out.
Hey Kylie. There might be lot of reasons of internal server error. You can fix it by following this guide on common WordPress mistakes. Hope it will be use-full for everyone who is looking to solve 500 internal server error.
Cheers!
after wasting 2 days, i found something useful tutorials here with this tutorials i am able to do my self. 🙂
thank you author for sharing such a useful article. 🙂
Duplicator worked for me on a website that was about 3 months old. However, it didn’t help with my other sites that had massive data as far back as 2010. I wasn’t too happy about the notion of using phpmyadmin to backup and upload the .sql data. While it was the ideal way to restore a site, back in the day many servers would simply crash while trying to import anything the size of 2MB or larger :-/ I was out of options so I gave phpmyadmin a shot and to my amazement, my 7MB .sql file uploaded successfully. Finally this dang thing works! Thanks for the article, it give me enough hope to give it another go 🙂
I see sometimes it is not copying widgets data and site settings from some complicated themes
Strange…It should, but the issue wouldn’t be with the theme but the migration, because the database stores this data, not the theme, the theme just gets it using core functions (or at least it should).
Thank you so much for this helpfull article.. It worked
My experience
Sometimes when you are migrating your page you can get blank home page.
I found the problem with the home page not displaying from the base URL. it was because there was a default.html file in the root directory. The old hosting server must had set the order to look for start files to PHP extension as the first default so it ignored the default.html file in the root directory and loaded index.php.
The new hosting server must have the default extension it looks for as an .HTM or .HTML file and was loading the blank default.html file first. Once I deleted the blank default.html file the hosting server started loading the index.php file and displayed the WordPress home page.
Thanks for sharing, it will probably help other users out there!
Hey Tom, what happens if your trying the reverse,migrating a domain to a WordPress website?
Hi There,
I have tried to do the same but after uploading the database, files and changes I am still getting the wordpress installation page.
Could anyone please help me?
It took a while but i managed to get it working in the end. Regular wordpress import/export didnt work. I had a website at about 500mb being transferred to a new host.
Great article – very in depth and well-written tutorial. Thanks for sharing!
About 3 years ago I got acquainted with WordPress for the first time – and it was really WOW for me. WP is a dream come true for non tech people such as myself. By the way, I moved my WP website to another host without shelling out for a developer (here is the tool goo.gl/B1cBki)
Just migrate my wp today, and bit stressed when i tried to import my sql which showing error (i forgot the error number) . And figure out at some other link that might be useful for other, that i have to use ‘use mydbname’ on my sql file
Done it 🙂 I have transferred my inqra.com from Bigrock to Hostinger. Only one change I have seen. After transfer WordPress admin panel is displaying for user registrations. Thanks for the instructions.
Hi, I’m about to move my blog to a new host but I’m worried about the URL. Will there be any change in post URL after moving my blog? And is the “step7” necessary if I’m using the same old domain name?
If you are using the same domain name then no, there isn’t anything to worry about in terms of altering the URL 😉
Very good tutorial, everything works fine, thank you! 🙂
I have one more question: -If WordPress saves my Pages in database, how can I update my new web site migrated from local to live? Does it mean I must change the database every time I want to expand my site for a new menu option (Page)?
As long as you changed your site URL’s correctly in the database after migrating you don’t have to edit the database every again, because WordPress will save pages using the updated URL.
Excuse me AJ Clarke, could you explain in more details, please? I have one main database for local WordPress site which I exported, then on dimain I created in cPanel new database and imported main (from local). I used Search-Replace-DB script you recommended to change URL, and now I have no idea how to connect local WP with live (migrated) website so that if I create new Page in WP site (locally) that it could be automatically updated/transferred on live site (web)…
Thank you.
Hi Emin,
You can’t just create pages on a local host and have them automatically migrate over to a live site (at least not that I am aware of – maybe there is a plugin out there for this…). The purpose of this article is to explain how to migrate a completed website.
Many Many Thanks Dear, I have done it help by this post. Alhamdulillah!
Works like a charm! My blog was pretty big w/ thousands of posts, still worked. Thanks! 😀
hi tom i recently upload a wordpress site with same step but at a first time my site never open properly it always miss use css or javascript and i want to reload each time to see properly.
Hi….I had make a copy of all my wordpress folder and backup database for migration to new hosting and new domain. But when I start to browse after completing all your instruction above, got response: site was not open and redirect to save file.
Anyone can help me ?
Do we need install the Wordpres in the new hosting and domain?
Thank you in advance
Unfortunately I have never heard of that error. You may want to start over and try again or contact your webhost to see if they can assist. A lot of managed WordPress hosts include free website transfer where they will move your site for you if you are switching hosts.
Fantastic tutorial. Worked flawlesssly for me.
Glad to be of service 🙂
Hi Tom.,
Thanks for sharing this article. I’m planning to move my blog to a better hosting service. Bluehost and Hostgator are my preferences but I’m confused. What will you suggest ?
Selection of the web host is a major point for the bloggers. Any wrong selection will put them in frustration.
Blogging for the hobby is not at all bothersome, but if you want to make it as a career, then you don’t want to mess with trouble.
Being a new comer one should look for a quality, probably this article is best to describe things in a broad way.
Thanks for sharing a quality.
sunil k
excellent Article sir, Thank you
i did all the steps, but site looks blank page
You probably have a PHP error, make sure WP_Debug is enabled to check.
Don’t we need to change the nameservers? Please tell, after which step to do it
Correct, changing nameservers would be the final step. This guide is for migrating the actual website itself. We don’t mention anything about the nameservers or domains because a lot of our readers are following the guide to move a site from their domain to their clients domain so these aren’t necessary steps.
Hey,
Thanks for the tutorial. I am still having some trouble here though… perhaps you can assist. So I exported my DB as explained. copied my files as well. wp-config is setup with the new db name/username/passwords etc.
when I finish the whole process and load my site, Instead of seeing my site… I get the screen you get when you just install wordpress- where i need to select the language (english USA) and then give a sitename, etc. but im left with a simple plain wordpress blog, nothing from my original site… any idea what i might be missing thats causing this?
Make sure the wp-content.php file on the new host has been edited correctly to point to your new database where you imported your old site.
Thanks, worked like a charm 🙂
I fully transferred the wife site over to bluehost. It took a full 6 hours but it worked with 1 small hitch with the WP-config file. Other than, it worked a dream. Good job I know what I am doing. Used my own methods, and it worked. 🙂 thanks for the hints.
thanks for this useful information… you r a great person.
Thanks for the information, I just implemented the steps and it work fine
Helpful Article, Thank you !
Hello, Thank you for your article! However, I have a question about this sentence: “This backup however, requires a more manual approach.”
I didn’t do it manually. I used the Updraft Plus Plugin.
It worked, but should I have done it your way?
Thank you!
Updraft Plus looks like a cool plugin thanks for sharing!
Awesome post man. First time, I had the database error then I deleted everything and started the process again. This time, viola it worked. I have used this process many times already and I don’t even have to read from the blog anymore. For those who could not start their sites after the migration, just delete everything including the database and start again. Just like learning anything new, it will all make sense after a few tries.
Thank you very much for your help. My site uses a child theme and so have two .sql files. Where do I put the second one, and would I need to do anything else in addition?
Using a child theme doesn’t make a difference to the WordPress database, you should still only have a single database for your WP site.
I have a question about links I found in the root of the host’s site I am moving away from. They are called access-logs (which will not copy) and www (which did copy but it is very large and became a folder on my pc). I think both of these were created when I first published. Can I proceed without them? Thanks for your help.
Yes, you don’t need to move these.
Excellent work done….thanks a lot
i have the a message problem with sql where by it says port 3306 is being used so how can i change the port to have access to my files
Tom, can we upload only the wp_content folder,the .htaccess file and the wp_config file to the new host
?It will save a lot of time and struggle. Plz reply
yeah sure u can..even you vcan leave the .htaccess file and upload rest.!
Hi Alagh,
In order to work, a WordPress website needs its entire file structure and database. I’m afraid that those files and folders wouldn’t be enough.
Cheers,
Tom
Today I migrated my 3 websites to a new host successfully using Duplicator plugin. Remember your site should not too large.
Hi, I changed my hosting service provider from godaddy to hostgator and now I am unable to upload any images.
Hostgator technical team is unable to resolve the issue.
Please let me know if anyone has solution.
If you need my services I can do this for you.
Excellent post Tom – followed your steps and it worked perfectly the first time!
You should add some info under step 4 though about updating the DB_HOST. That part threw me for a little while – because my old ISP used “localhost”, but my new one (Network Solutions) doesn’t. It took me a little while to figure out where to get the information for that. At Network Solutions, it’s different for every database.
/** MySQL hostname */
define(‘DB_HOST’, ‘db_hostname’)
I was having the same problem pamelainmn – took me quite a while to figure out that the localhost needed to be changed to match that of my new web host. Maybe that should be added somewhere in the article.
Thanks for this helpful guide! I have followed the steps above, but now when I visit my homepage I’m told “This website has a redirect loop”. Any ideas how to fix this?
This may be something best to ask your webhost. Many things could cause this so there isn’t much help I can provide without actually logging into your site, web host panel and database to make sure everything is setup correctly.
Hi,
This looks like a great tutorial and I would also like to make a copy of my site soon but I still have to collect a bit more courage and info since I am not so experienced.
I would like to make an exact duplicate of my existing website on another server with another hosting company, but keep my old website exactly as it is, don’t change anything there. Basically I think you can say that I want to create another, new website at another domain/URL, which is (at least starting as) an exact copy of my existing site (which just keeps existing, untouched, like it always has been).
How does the ‘final work’ in my case look like? How does it work in step 7, is this process still the same as described here with the ‘search & replace’? Do I understand it right that in my case I don’t have to perform step 8?
In the article it says:
“Changing Site URL: By doing a search and replace for the old domain and replacing with the new domain you’ll also be altering the site_url and home url values in the database (Changing the Site URL) which will ensure that when you try to log into your site on the new domain it doesn’t try and redirect you over to the old domain.”
Does this mean that then you can login to both sites, the old one and the new one, and edit them separately from each other?
As you can notice, I still have some difficulties to wrap my mind around the final steps of the entire process. Any help is welcome since I am very interested in understanding how it works.
Do you know more articles which can also help me to understand it better?
Thank you in advance!
Are you moving to a new webhost as well? Because a lot of the good webhosts actually provide free migration services so when you sign up they will migrate the site for you. This tutorial is geared towards people with moderate to advanced web experience that will be migrating multiple sites in the future (such as for their web design clients) but are new to WordPress. If you are just moving one site and you aren’t sure how, why not just hire someone for a few bucks they will migrate the site for you, no point wasting time learning and figuring this stuff out and you can get straight to working on your sites which is the most important part 😉
Wow! I can not thank you enough!!! I messed around with 4 different scripts, none of which did the job (Duplicator, BackupWP, etc…). They not only did not work (would corrupt the backup OR miss entire sections of website), but crashed the server with 508 errors… I was so disguisted at the lousy coding… Its the website size that seems to be the problem… these softwares assume it’s 1989 all over again, and a website is “huge” at 32KB…
So, I used your method… zipped the entire system, used the database transfer,and then the search/replace DB tool worked beautifully…
Best of all? The entire 3 stage process took less than 1/2 of the time using Duplicator and its croonies that, in the end, produced useless results (like the website home page but zero interior pages or posts…).
I tip my hat to you… you literally saved me hundreds in additional support time… already cost us 2 productive days with the new site, but in less than 1 hour, we were done, up, running with full conversion of all links!!!
Kudos, and Merry Christmas to you!
Thanks Tom, Your tutorial is great, I have successfully moved my site without breaking any code.
Excellent Tutorial.
One thing I’d add. Super-Cache is a very common plugin. When migrating look in the root directory and find wp-config.php and change the path to super catch:
Cheers, this is a great walk-thru. Helped me out a lot, sped up the process!
I appreciate it.
Thanks AJ Clarke!
Step by step I am coming to the same conclusion, I think this is a bit too tricky for me and I will sleep calmer when I decide to let someone else do it.
Maybe I will in future still experiment with it (simply because these kind of things interest me :-)) but for the moment I think I will go with your advice!
Many greetings,
Janny
Hi, guys,
I was try to move my website from one hosting to another and this article shared so much light on my problem.
I have followed all the step carefully and completed the process.
My problem now is that wp-admin shows blank page, and site on frontend is all broken.
Don’t know what i messed up. Do I have install wordpress before the process or it will accept when upload the files thru ftp.
Kind guidance will be much help ful.
Thanks.
I would recommend enabling WP_Debug on your server to see what errors you may be having so you can fix things up accordingly.
Perfect and complete. Thanks even newbies like us can do it easily.
thanks the tutorial ..very usefull
I followed all the mentioned steps, but I got this message when I try to refresh the homepage
403 Forbidden
You don’t have permission to access / on this server.
Apache/2.4.18 (Unix) Server at hereinemirates.com Port 80
Please contact your webhost for assistance, unfortunately since it’s a server-side error there isn’t much help we can provide.
Very interesting topic. I am new to word press and my site is listed below. I am having problem with my host, so that’s the reason, I am reading this article. I think it is tough for me to move at the beginning.
I tried to migrate following the steps of other blog posts and using plugins.
This time I tried to migrate using your method and worked perfectly well. Thank you!
Hi, I am not quite changing hosts. At the moment I have an HTML site which I want to convert to WP. So I need something like www*mysite*com/wp and then when I have wordpress working how I want I then want to make it my site index page. What would be the best way of doing this? Thanks
Technically this would be the same thing as migrating to a new host except you can skip a few steps. If you have an HTML site I would recommend maybe just temporarily redirecting it to a “Coming Soon” or “Under Construction” page and just install WordPress in the same directory while you move things over. Using themes like our Total theme you should be able to create a site in just one or a few days.
Brilliant instructions – followed them word for word and now have a 2nd installation.
I had hoped to keep installation 1 current whilst making changes to installation 2 – a complete rebrand so it’ll take a few days… but when logging in to instal2, I’m re-directed to instal1 (I haven’t re-directed DNS yet.)
Does anyone know if there’s a way to stop this redirect? I’m trying to log in using:
new-host-domain-address/add-on-domainaddress/wp-login.php (which does exist)
but keep getting re-directed to:
existing-domain-address.co.uk/wpadmin
as soon as I enter my password. Could it be that my links won’t be sorted until I complete DNS transfer and wipe the old version?
Would really appreciate some advice. Thanks
THANK YOU!!!!!!! SOOOOOO MUCCCHCHHH!!!!! you saved me! the duplicator plugin was returning a 500 internal server error due to the size of my site over 300mb and I had to do it manually using your tutorial!
thank you!
Thanks a bundle for this step by step guide. Following this I was able to migrate without hardly any problems. The only small problem I had was a tiny php.ini file that I copied over from the old host. This caused the site to go to the dreaded “white page” when a wp-login attempt was made. It also caused a lot of plug-ins to crash. It took me a whole day to find out the problem, so if anyone else has the same happen, this may help.
Best tutorial ever. Thank you.
Awesome! Just migrated a site as instructed and worked perfectly. Thank you.
When I try to get to the wp-admin area I get the error:
Warning: Cannot modify header information – headers already sent by (output started at /home/dferg24/public_html/springboroucc/wp-content/plugins/gallery-bank/gallery-bank.php:903) in /home/dferg24/public_html/springboroucc/wp-includes/pluggable.php on line 1228
It appears the error is coming from your gallery-bank plugin. I would recommend you try deleting the plugin via FTP to see if it fixes the problem. Generally this error happen if there is an empty space at the top of a PHP file.
Curious how this will reflect the SEO of the website? Especially whe you move your hosting and domain!
Simply wonderful! Such a great guide to this job without boastful blah-blah, thought about all details. If someone fails the migration in the end, he should better look for another job. Thank you very much, dear author!
Lifesaver!!! 🙂
im must be missing something why would you point the new site to the old DNS server?
The post is simply saying that once you move your site to make sure to log into your domain registrar (such as Godaddy) and make sure your domain is pointed to the new web host and not the old one.
Tom … thanks a lot sharing this document , It really helped me in recent transfer of host.
You’re welcome Divya 🙂
Hi, what if we are retaining the same domain?
If you’re keeping your domain name you just need to point your domain to your new host (which I think can take any where from a couple hours to a couple days), so no need to change URLs in your WordPress files 🙂
Before importing the database .sql file into the new site, are you supposed to rename it first? When exporting obviously the name is for my old database, so when importing into the new site, should I rename it to my new database name?
It doesn’t matter what the database name is, just be sure that the wp-config.php file for your WordPress installation is pointing to the correct database.
Thank you THANK YOU Tom!!! Just completed my first move with your guide and it went as smoothly as I could have ever hoped for… I really appreciate it and am truly grateful!
Great article excellently written. Clear and simple instructions. YOU ROCK!
For me “Un-tick the Partial Import check box, make sure the format is set to SQL and then click the Go button. The database import will now begin” part caused some import errors, I have ticked back and the transfer of SQL database was successful. You should update your article and mention about this issue as it can cause trouble for some people – I am on Awardspace.com hosting plan.
This is very helpful article, thank you so much.
I’m about to move to my new host after my old one got hacked like crazy. Im sure i have scanned all my files now and following the procedure.
Thanks a lot for this wonderful guide. Every web developer must need it bookmarked.
This is really very useful . It solves the trick that I forget to do
thank
I’ve migrated quite a few sites before but usually on the same server and just to root level. This time I have had to move a development site to a new host server, the steps I followed are the same as above and the site works fine, the only thing I can find wrong is that there are still references to the old host server in the database but this doesn’t seem to actual affect the site, not visually anyway.
Any ideas?
Thanks.
Comprehensive enough. It helped me to move my site by myself. Thanks.
Great post!! It has everything one need to know when migrating site to a new host.
Thank you for awesome knowledge.
This as the clear form of tutorial I have seen so far.
It really made my migration quite an easy task.
Thanks a big bunch.
I am having an issue with the PHPMyAdmin bit – i click the phpmyadmin button in the cpanel, and it goes 404: requested url /phpmyadmin was not found on this server”
I’m using AWS server and ISPConfig hosting package.
To be honest I am not sure why that would happen, you’ll need to contact your AWS server host.
I used different sorts of plugins for a WordPress site migration and I always had to debug some silly issue that happened.
With my experience nothing beats a migration that the hosting company can do. Their admins are more experienced anyway so why bother to migrate something that they do jokingly easy.
I know lot’s of web hosting companies charge for these kind of migration but I’m lucky that my current host doesn’t.
Simple and Straight forward post.
Just want to add, I needed to reload permalinks (website.com/wp-admin -> Settings -> Permalinks) I chosed Post Name and “Save changes”
and all working perfect
Hi Tom, Thanks for the article, it is amazing and easy to follow. But just a question, i am stuck at the point of uploading the files to the new host using ftp. The ftp client does not authenticate my account and gives password error while trying to connect. I tried to change my password and try to reconnect but it doesn’t help. Pls tell me what to do. I am using filezilla, i used other client also like coreftp, but no success.
pls help.
Thank you so much..I am following your steps for my site 🙂
Hi.
Thanks for the awesome and clear article. I needed to migrate my client’s websites from Godaddy to a new host. I was still confused on what to backup and what is going to be needed later then. But your quick article have made me understand everything.
Thanks once again! 😀
I get a blank white page, with loading…….page failed to load.
It changed my links, but I cannot login at /wp-admin, and none of my post, menues etc. are there.
Currently at: freerundenmark.dk/flyttetest/
Tried to duplicate it from freerundenmark.dk/dennisasp
What went wrong?
Hi Dennis,
Did you actually import your WordPress database? It seems when looking at the site that you have WordPress installed correctly but you are missing all your content. Make sure you have migrated all your wp-content files as well as your database. Also make sure in your database you have changed the url from /dennisasp to /flyttetest otherwise the database may be linking to the original URL so it won’t let you login.
Hi, thanks for the great tutorial, although I have some questions.
I have just downloaded my database and site files (files in folder public_html) trough FTP. Now I have connected to my new server for the first time and I can see that it already has files in its public_html folder.
Files like: assets, cgi-bin, css,images, js, .htaccess, 502.shtml and parking-page.html.
Am I supposed to delete these files and then upload my own files which I downloaded from my first server?
Hi,
You need to be careful overriding some files. You should only be migrating the WordPress related files and your .htacess file. Some files such as cgi-bin are specific to your server so you should not delete this. If you aren’t sure what you can and cannot delete I do recommend reaching out to your webhost for some assistance.
Hey Tom/AJ, I’m moving from hosting from GoDaddy to West Host. This is what I did – I found that in the applications installer on West Host, there was an option “import” my WP installation from GoDaddy to West Host. I did this and although the import was successful, obviously the main content files are still in GoDaddy, do you reckon, now manually uploading wp-content folder & wp-includes might work? At this stage possibly the DNS hasn’t finished propagating and what I’m seeing is still the website at my old hosting provider (GoDaddy), but before shit goes down, I’m trying to get everything right 🙂 your inputs are much appreciated. Cheers, Suraj (theinsanefoodie.com)
Hi Suraj,
You really should contact West Host about this. If they have an auto import system it should import all your content as well – if not, that’s a bit useless. I would bring this to their attention as maybe there is just a bug that needs fixing or maybe they can update their importer to actually import everything. Of course you can go back to Godaddy and download all your content via FTP then upload it to the new host via FTP, but really the importer should do all that for you. Personally, I have never used West Host. Let us know how you end up liking that hosting service, I am curious to know if it’s a good WP host or not. Thanks!
I get a URL not found on host site. if i haven’t changed the domain name, have the domain pointing to the right host, where else? Please don’t say step 7, as it really is not clear imho. For example, why do you need to change site URL if not changing the site name? And on the search and replace for any instances of old domain name (and in my case, domain name is not changing), is that a search of the SQL database or something else (like the wordpress files). I believe it is the SQL database. Thanks for any assistance!
Often times when migration your site you will be changing the domain name, if you aren’t then this section doesn’t apply to you (I will edit the post to make that a bit clearer). In terms of 404 errors it could mean anything and usually it’s an issue with the .htaccess file (I recommend checking it and making sure it has the default code used in WordPress). Prior to migrating your site did you have a live version of WordPress on the new host and it was working and you started getting the 404’s after migration or did you move over the entire server with WordPress, database. If you were switching hosting companies you should be able to just open a ticket with your new host and explain what is happening and they should get your site fixed up for you.
Great article, I have been looking for clear instructions for a while and this definitely serves its purpose. Good job.
Some feedbacks based on my experience migrating a 7 years old blog to a different host, following these steps:
1) importing/restoring the database to the new host could fail if the SQL file is too big. In such case I suggest to SSH to the new server and run the MySQL command directly. You will have first to SCP the file to the server:
mysql -u root -p database_name < full_path_to_your_file.sql
2) If the size of the WordPress files is very big (in my case was over 10GB) a good idea is to ZIP them before pushing the files to the remote host. It will save you some time.
3) If after the migration you get an error accessing any post it could be that you have to generate again the .htaccess file, in such case I found this article very useful:
Hi followed the same steps,
Except homepage all other pages are showing “404 – File Not Found”
website Address is: [edited]
Kindly check and help me out
This is usually do to .htaccess errors, most likely nothing to do with your migration. We have an article about fixing post type 404 errors that may help (see the first solution).
this was the only guide that works for me to change the WordPress to new site
thank you so much and keep the good work up
I have migrated sites with All-in-One migration plugin, but wanted to try this manual way. Unfortunately, it did not work for me, and i don’t have a clue why. This is the error:
This site can’t be reached
The webpage at [url] might be temporarily down or it may have moved permanently to a new web address.
I see you have your site back up and running now. What was the issue you were having? If you are willing to share it may help others, thanks! Because the error is so generic it can be any number of things.
Hi, to be honest, I have no idea. I had submitted a ticket to my new host and by the time they looked at it, the site was up and running. I have a new problem which i will make a separate post.
Many thanks for fantastic tutorial! I’m in the process of changing hosts and usually in the past would delegate the WordPress transfer because dealing with darabase transfer was always too intimidating for me. But after reading her instruction I decided to give it a try and I am so glad I did it. It is very precise info, so it went great. I am already transferring sixth blog, two more to go – it is so easy now, very happy that I learned to do it myself, it saved me a lot of money.
I had to add the following lines to my wp-config.php file in order to prevent the new site from forwarding to the old sites domain.
Thanks for the clear tutorial!
Thanks for the added input, hopefully it helps others 😉
hi,i was able to transfer my wp website and it was up and running till i clicked on any link, on the next page it says “The requested URL was not found on this server”.Any idea what i did wrong or how to fix this.Can any body help with that.
If you can log into WordPress it may just be a permalink issue and you can try going to Settings > Permalink and clicking the save button to update your .htaccess file. If you can’t access the WP admin or that doesn’t work I would recommend reaching out to your webhost and they should be able to assist, especially if you are using a Managed WordPress hosting solution.
Thank you so much for this detailed post. Your post was my lifesaver today as I switched my WordPress site to a new host. I’ve often heard people say how Bluehost is the “best,” but there wasn’t anything on their site nearly as comprehensive as your post. I had a few hiccups with FileZilla, but I worked it out. Bluehost also mentioned that I needed to upload the FTP files via FileZille before uploading the database, but other than that your steps were perfect for me. They also helped me ask informed questions and get back informed responses. Otherwise, chatting with support for either me old company or the new one can be a headache!
This saved my life :)) Thank you so much. I moved my website to another hosting company, and i forgot i have to copy db too, i only copied the local files and i was stuck trying to figure out how to connect the new db to my old files. This tutorial was great! Thank you very much 😀
Hi, I have found your blog very interesting. I was finding the trick to move my WordPress site to another host and your blog helps me a lot. thanks for writing this important blog.
This article was so helpful as I finished transferring my website to a new hosting provider. Thank you for taking the time to explain things so clearly.
PB
Thanks I have managed to transfer my WordPress blog to the new hosting by following your instructions and thanks again.
Very easy to follow article. I just migrated 2 domains quickly following this. The DNS propagated immediately so I saw results as soon as I saved my new nameservers. Thanks for posting this!
Wow! I was migrating a LARGE site (4.5GB) from one web host to another on the same domain and URLs. I followed the instructions here and everything went very smoothly. I usually use a backup/migration plugin but none of that was necessary.
Thanks to the writer!
Thank you so much!! I struggled with this for hours and could not find a site anywhere that explained it in plain English. This was easy to follow and got the job done! Thank you!!
Hi, recently I migrated my website to a new server provided by Hostgator. Everything is fine except one reason. All pages are showing properly except the home page is not displayed, it is showing the website is under construction. The default coming soon page is not enabled. How to solve this problem? Please help.
Hi Avik. If the theme’s under construction option is disabled and you don’t have any plugins enabled for this, it may just be the Hostgator’s under construction function. They have a built-in option for this. By the way, let me know how you like Hostgator, generally I don’t recommend it because it is one of the slower and not so good options for WordPress hosting. I am curious to know your thoughts if you are willing to share 😉
Awesome guide. Thanks!
I’m a few years late to the party, but I just followed the steps to migrate one of my biggest sites and it worked perfectly. I tried other tutorials that recommended using a free plugin but it didn’t work. Thanks for this!
Hello Tom!
This is a great stuff and worked fine.
Actually I have had some issue during the migration like:
1. PHPMyadmin import problems because of Gateway Timeout Error. Solved
2. Search and Replace was buggy. Fixed 🙂
3. We have to change the apache/httpd config file too. Solved
Anyway it was a very good tool and thank you again for it.
George
I’ve been using Magic Migration to move sites for a few weeks now since I got tired of doing it manually. This tutorial was my go-to though until I started using that so I want to thank you!
I suggest using MAMP PRO 5.0. With the new version its very easy to migrate a WordPress site from one host to another.
This worked a treat!!! Thanks Tom and AJ for the clear instructions! Really informative and the best tutorial I found for this process by far!!!
Just did it for my blog after changing host, worked fine (after DNS replication was complete), many thanks !
Thought it would be so much more complicated than these easy steps =)
I realize that this is an old post, but I followed the instructions quite easily, with only the one issue after reinstalling. Received a 500 Internal Server error mentioned above, which was the result of the .htaccess file being corrupted upon upload. A quick google found this solution on Elegant Themes blog.
Hi, I’ve just successfully migrated our site to our new hosts by following your instructions to the letter. Thank you! It’s really well written and streets ahead of others I found.
That FileZilla crap results in a malware named Chrominium installed stealthily on my computer. Thank you for wasting my time.
Oh jeez – I didn’t realize they were bundling programs. That’s a shame, because I used to use FileZilla because it was a solid FTP option. I updated the article to link to my current FTP of choice – Transmit for macOS. In any case, thanks so much for bringing this to my attention!
Hello AJ and please consider our free Export Database plugin too, its easy to dump SQL file immediately. Similar with the phpmyadmin function, but can work if host did not support phpmyadmin. Thanks bro
Thanks for creating this detailed tutorial saving me hours of time. However, I notice that if you move a site with SSL certificate (https), you need to make sure you install a SSL certificate after the move, otherwise, it simply won’t work. Also, for some shared hosting customers, they may not have cPanel available to them and they need to rely on some backup plugins such as BackupBuddy or WpDraftPlus to create a complete backup for them. For some reasons, I need to deactivate my security plugins to let BackupBuddy performs a Complete Backup, otherwise, it’ll fail.
Hi, I’ve read through this post and the comments. Lots of people have benefited from this post, that awesome. But I don’t know why the steps did not work for me. First off, am migrating to a different server and am changing my domain name. But am have problems with the search and replace script on github. I ran the script and encountered a 404 error. When I browse my wordpress site I see this error message “Oops! That page can’t be found.
It looks like nothing was found at this location. Maybe try one of the links below or a search?”. Please how can I resolve this?
Sadly, a terrific disaster. First issue was—after completing all of the steps, when I tried to log into wp-admin I would get bounced to the log in page at the old url where the site used to be. Had to edit the database, but got that resolved. Then, I couldn’t log into my wp-admin; it was still using old credentials from the previous install. But, when I logged in with the old credentials, the admin was a generic WP install with none of my site files or settings. Plus, the “visit site” link produced a “403” error (“you don’t have permission to access this site…”). So, I gave up and begged my old host to take me back.
Hi,
I’ve been gigven the task of reviving a website on a new host. Although, as I hadn’t ud#sed WordPress I did the new site in another program.
However, I have a full backup of the old WordPress site that I would like to have a look at to grab some of the info that used to be on it.
So, my question is, is there a way of viewing a wordpress site / restoring a backed up website without have an associated domain name ?
Thanks
Steve
You can always create a local test site (using Local by Flywheel, DesktopServer or a program such as MAMP) on your computer. Or you can build a WordPress staging site if your hosting plan allows it. You shouldn’t have to tie it to a domain (most staging sites are a subdomain of your hosting), and you can just delete it when done.
Thank you! You saved me ♥ My ex deleted my blog and all I had was a back up. It took me some try and error moments, but finally I made it thanks to you!
Amazing post!
Worked like a charm. When was this article written?! It worked in 2018 like.a.charm. Tom, you’re awesome! LeavingWorkBehind rocks as always 🙂
Very good! Worked perfectly for me.
Glad to hear it!
Thanks for the clear advice and guidance. We moved some sites over to a new hosting platform and the usual method we use – iThemese BackUp failed for some reason. So returned to FTP and MySQL basics and all good. Also FileZilla has caused a few installation issues so will take a look at Transmit.
I had “problem connecting to database” issues until I changed the hostname in wp-config.
/** MySQL hostname */
define(‘DB_HOST’, ‘change_it_here’);
Easy enough to do. Your Step 4 gave me an idea of where to look but it does not mention checking the hostname. Once fixed the site worked. Hoping this helps someone else someday.
I’ve probably read through a dozen different WP Migration articles and this is literally the only one that hasn’t left me completely confused. Thank you!
Thanks, Tom. I followed these steps to move a friend’s site to his own hosting.
Thanks Tom, so useful!
You are the best, thank you so much man
Hi, thanks for this guide. Im getting stuck at importing my edited database file.
There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem
ERROR: Unknown Punctuation String @ 1
STR: <?
SQL: <?php
/**
Theres a lot more but this is the beginning. Any tips?
If your exported database will not import it sounds like the export file is incorrect (your export file should definitely not start with PHP tags as you mentioned), I recommend you re-export your database via PHPMyAdmin and make sure to do so in the correct format “SQL” and make sure you are importing it into a new blank database on the new server.
I have large number of input fields while exporting under such headings as Structure, Data etc. I could perhaps add a screenshot.
Unsure what parameters to use during export. Using default does not seem to work. (I tried local server, where it did not work)
Hi there.
When you first log into PHPMyAdmin click on “Databases” at the top than select your database from the list that pops up. Now click on export. When the page refreshes make sure the “Format” dropdown is set to SQL. You should see any input fields during the export. All that you should see is this:
Thanks heaps for this! Been struggling with the order of the steps for a while now. Followed these steps and it just worked.
Awesome, I’m glad to hear that! If you have any suggestions for making our guide even better let us know!
Great post, this is my “go to” for when I am moving a site out of my staging site, to live (two in the last week, so this has been a terrific resource). A couple of things I do differently more out of necessity than anything, but this a great list for me. Thanks!
Hey, I’m glad to hear that. I would be interested in knowing what you do differently and if you have any tips to make our guide better. We’re actually going to be adding a section for moving your site using a plugin for those that want to skip the manual method and use a plugin instead, so if you have every used a plugins and have recommendations for that I’d be interested to know as well. Thanks for stopping by Adrian!
A fantastic tutorial that worked a charm, thank you so much!
Nice done, it helped me to move the whole site from one server to another. I did found only one thing which was changed – I had to manually set the ‘permanent link settings’ to be able to see all sites like on the gammal server.
Thanks for the excellent guide. Worked flawlessly!
That’s great to hear! We’ve tried to keep our WordPress migration guide up to date to help folks get their sites moved to new hosts, so I’m glad you found it helpful!
Thank you so much Tom! Excellent tutorial, well explained step by step. Bookmarked!
So glad our guide could help!
Hi, this write up was really useful, but I had one problem – my website has a very large media library (a few thousand images), and a lot of them are missing after the transfer. The info is there, names, dates and captions, but the images themselves are gone.
Any idea why this might be?
This could be due to a few reasons. Did you move your wp-content folder (or whatever folder was holding your media) with all your images from your old server to the new one? Also did you make sure to do a search/replace on your new database for the old domain name and replace it with the new one?
I would recommend you check your browser console to see if there are any errors when on the media page. It’s possible the images are transferred correctly but aren’t showing simply due to server permission issues which would be a quick fix by using the chown command to properly set permissions on all files on the new server. Or contacting your webhost to do this. You should be able to know the issue by reading any errors in the browser console.
Thank you a lot!! Saved me some time and research! Added to your newsletter, too! Many greetings from Germany!
So glad our guide could help!
Just wanted to thank you for such a clear and helpful guide! I had been trying to transfer my backup to a new server for over a month with repeated failures until I came across this guide. My website is now up and running after my first try of going through these steps. Honestly can’t thank you enough for this!
Duplicator ftw. Best ever!
I have always struggle with this kind of things, but with all your help it turn to be very easy and fast. Thanks a lot.
Excellent guide, thank you.
Just moved my website server this morning and everything worked fine, the site was down for about 10 mins but a perfect copy of its old self. So I just wanted to write in and say thanks for your very clear instructions.
I did all the prep work during the week and had to redo it as changes were made to the site. That meant that I read the article more than once which only raised my appreciation of it.
Well done!
Although many things mentioned in this article are obvious, they are easy to miss. Thank you very much for compiling them in steps and describing each one of them in details. This list becomes so handy while migrating.
I followed the steps but I get Error establishing a database connection. Not sure what i did wrong. anyone help?
Double check your wp-config.php file and make sure your DB_NAME, DB_USER and DB_PASSWORD constants are all correct.
I followed your directions and just moved my WordPress site to a new host without a single issue! Thanks!
Now I’m getting reading to move another WP site from the root directory of my current hosting account to a subdirectory with my new host. Is there anything additional I need to do?
I have done all this things during change my host, finally the site URL shows an error “This Account has been suspended.” with “cgi-sys/suspendedpage.cgi”. May I know the reason.
I’m pretty sure this is an error when your hosting account has been suspended. I would suggest checking in with your hosting company to be sure your account is in good standing, and if the error is still showing up have their support/tech team take a look.
I have actually migrated a site using UpdraftPlus in a reverse way. I created a new WordPress site, installed the Updraft plugin and then ran a restore on a site using a backup of a new WordPress site and it worked perfectly. I don’t know if i just got lucky doing it backwards but I have done it this way and had it go smoothly.
Thank you so much, this was easy to follow step by step, everything went great!
The information here is apt. I have moved several site from Local host to live host and also change from host to host. While the plugins like duplicator and Wp migration are great they all have their limitations. I prefer the manual approach i.e connecting via the FTP is the best.
With the steps stated above, bravo to you
Hi, very nice, it worked for me, 1 thing, i had to install basic wordpress first on the new hosting provider, only copy to the new hosting provider did not work.
Greetings M.
OMG this article saved me. I was already trying this on my own but it was STEP 7 that I was not doing and couldn’t figure out. Thank you so much for the write up and what a great replacement tool from github.
This worked a treat but I would add one piece of advice right from the beginning. Make sure you update WP to the latest version before exporting. I exported a website running an old version of WP and this caused a conflict between one of the WP core files and my fresh installation which meant I couldn’t even get into the admin of the site to update WP from the dashboard. It took a while before I found the code and edited it.
this is so simple tutorial even a newbie like me could move WordPress site from old host to new hosting. Thanks Mate 🙂
Great tutorial! Very easy to follow along with!
Thanks, this was very helpful!
Success! Thank you SO MUCH!
I have migrated several sites to different servers (keeping the domain name the same thankfully) usingy your instructions and godaddy instructions and a big problem i had that really confounded me was that there is a place in the database in wp-options where there can be a hard code to the uploads file path that was causing my migrated sites to crash as soon as i tried to upload an image. it took me forever to figure out, a tech at godaddy finally suggested it when i phoned for help, nobody seems to mention to check in the wp-options to fix the upload path in migration instructions. (maybe that would be changed if i did the search and change step but i didn’t do that because my domain name was the same, i just moved servers) Thank you!
Excellent info. Exactly what I was looking for. Thanks for sharing.
I want to say is you saved me. I was totally lost what to do to transfer the website. My old server shuts down and I had to move to new server. I was totally lost how to transfer the website. Your article saved me. I read your step by step procedure and the website is on. Many thanks to you Tom.
Hi Tom, thanks for this, I really appreciate this online tutorial. I wanted to know if it’d be possible to migrate new content to our website (intended to replace the old, existing site design and content). The current website that we have already has a WP installation + data. I was hoping to install new content into a subdirectory, to show the new design to the team, but would like to preserve the old/existing data and keep it as default for now. I’m concerned that uploading the new database will eradicate/replace the existing one, and would like to avoid this possibility. Is there a way to do this? Thank you.
Does your hosting plan allow for staging sites? For example, WPEngine allows you to copy your live site to a staging site, where you can make all kinds of tweaks without effecting the current live site. When you’re done just click a button to push your staging site to live and apply your changes. Alternatively you can use a staging/migration tool like Local (originally part of Flywheel) to make a local copy of your website, make your changes and when ready push to your production site (note – there is an option to also push the new database).
Thank you Kyla, I’ll definitely look into Local and WPEngine
Thank you, very clear information.
Do I need to install WordPress on the new hosting?
That depends on your hosting. For example, if you’re using WP Engine or another managed WordPress host then WordPress should be already installed and ready to go. But if you’re using a general shared plan (Bluehost, Host Gator, etc.) you probably will need to install WordPress – but most offer a quick 1-click WordPress installation so it shouldn’t be a problem.
My wp-admin takes me to the old domain where the staging site was hosted… any idea how to fix this?
Make sure to do a full database search and replace to change the staging domain to the live domain. Also be sure to clear your site cache incase your browser has cached any redirections.
I had move my site before and lost a bunch of my “featured images.” That sucked pretty bad. I moved hosts so when I tried to restore from the backup, it was also missing it. I made a mistake on how I handled that one. I’m looking at it again and I’ll err in the side of double safety this time. LOL.
Good plan! You never know when your backup might come in handy!
Worked perfectly, no errors and no downtime. Had tried the Duplicator plugin but my site was too big I think.
Thanks so much!
When migrating a site manually like it is explained here. Do you need to have all the plugins installed on the new host first?
If you’re manually moving all of your server files to your new host there’s need to pre-install plugins, as they (along with themes) will be included in your website files that you backed up and exported.
Thank you. I am trying migration for the first time and followed your instructions to the letter.
Got this error “ParseError thrown
syntax error, unexpected end of file”
It worked. I had to only install wordpress before uploading the files. Thank you so much.
I went through a bad migration experience using our hosting provider (not their fault) who got into serious difficulties because the site had been converted by previous hosts to WordPress on a Trellis structure (which I hadn’t heard of before). This isn’t apparent at all from the WP admin view, and wp-config and the file structures are all mixed up and things hidden to “make it more secure”. I had to get external assistance to sort this out, which they did do successfully.
Have you come across Trellis before?
I’ve never personally used Trellis. I think I read something about it on Roots IO a while back about it being a way to deploy dev sites, but since I just use the a WPEngine live staging site for my testing I never had a need to give Bedrock/Trellis a go. But thank goodness you got everything figured out!
thats nice blog everything explained in well mannered, I hope this will surely help with moving my site.
Thanks Guys
Glad we could be of help when transferring your WordPress site! And best of luck moving your site – I hope you enjoy your new hosting!
Excellent article. I’m yet to get on with my migration but I perfectly understand the process
Excellent article keep up the good work. It helped me move my database
You cn actually open the SQL DB in Notepad++ and replace URLs there. No need to run any scripts. Nice guide.
Really great article, many thanks Tom. You made the entire process clear and straightforward.
Great tutorial,
I’ve been moving my page + wordpress to the new host provider.
Everythin went smooth and super easy.
I couldn’t believe moving wordpress in the new location can be so easy
Once again – many thanks for your post – it’s a life saviour.
Best,
Jack
You guys are awesome, Just saved my time of manually updating them,
Thanks Guys!