How to transfer a wordpress site to a new domain on a new host

1)Do a file and database backup ( just to preserve the old site in case something goes wrong)

2) use filezilla to copy all WP folders and files from the old site to a folder on your computer ( call it old site) again just for safety I think

3) Go to dashboard on the old site > settings > general and change urls to new domain (this will kill the site)

4)Go back to filezilla and copy all WP folders and files from the old site to a folder on your computer (call it new site)

5) Login to your C-panel of your old site and old hosting and go to phpMyAdmin. Click on the database that belongs to your old site and click on “Export” at the top. Save the database somewhere on your computer.

6) Open the WP-config.php file on your computer in the new site folder with notepad and print it out so you can see what the database name, username, and password is.

7)Go to your C-panel on your new hosting company and create a database using “MySQL Databases” then create a “user” and add that user to the database you just made. Check the “all priviledges” box. If you can use the same names as on the sheet for the WP-config.php file you printed out, that would be great, but you probably can’t. So just name the database and username as close as you can to the original and go back and edit the WP-config.php file to match your new database name, and username. The password should stay the same so leave what is already in the WP-config.php.

8) FTP all the folders and files for “new site“from your computer to the new hosting company in /pubic_html

9) In C-panel on your new hosting company go to phpMyAdmin and you should be able to see the database you just created. Click on the database to highlight it and click on “import“. You will then be able to browse on your computer and find the database you saved from the old site on the old hosting company. Click “Go” to load it . Basically you have filled the empty database you created with the contents of the old database from the old site.

*Note the following may not be necessary and may have been done when you change the Urls on the old site under > settings > General . If you click on the database name on the left hand side you should see wp_options. Click on that and edit “siteurl” to change the domain from the old one to the new one, then on the second page edit “home” to change the domain from the old one to the new one. However do this for the old site on the old hosting to restore the old site if you want it up and running for some reason.

10) Now if you try to navigate to the new url on the new site you should get the site to load at least partially.

11) There may be many instances in the database where the old domain and urls are still referenced so some of the pages may not load or may load from the old site if it is still live. To fix this you need to install a file called “searchreplacedb2.php” that you can download from http://interconnectit.com/products/search-and-replace-for-wordpress-databases/

12) Copy the file over to your root directory using filezilla.

13) Go to yourdomain.com/searchreplacedb2.php and it will open a window where you can specify your old domain and your new domain. The tool will scour the database and replace all of the references to the old domain with the new one.

Should work and the site should be good.

*Note you may not have to do some of this stuff, but if you do it all, it should work. This is what I did when I transferred a site on hostgator to a new domain on crocweb hosting

Nov 2013

Leave a Reply

Your email address will not be published. Required fields are marked *