Moving a wordpress site from one server to another

If you have changed your hosting provider and you want to move your WordPress site from one server to another then this article will describe exactly how to do it.There are two scenarios, first moving from one server to another with to the same domain name and second changing the domain name while you move your WordPress site from one server to another. This article will describe how to move the site manually without a plugin with zero downtime.

Moving wordpres site to the same domain name on a different host

1. Take a backup of the root folder of your domain using a FTP client like Filezilla You will require to make a FTP connection to your hosting server using hostname(your domain name), username and password(ask your web host for FTP username and password) or you may create a new FTP account in your Cpanel making the root folder of your domain as the FTP root.You may also check if the FTP account already exists.

FTP download the root folder of your domain.If there are failed transfers,please re download the files or requeue the failed files and process them.Make sure all file are downloaded.

2. Login to your wordpress admin and from the tools -> export option download a xml file containing all your contents.You may not require this ,but it is a good idea to download the contents.

3. Login to your cpanel and go to phpMyAdmin and go the site database.Click on the database and from the Exports tab download a .sql file containing your complete database.

Now you have finished backing up your data.

4. If you are using windows open notepad in administrator mode.Open the hosts file located at “C:\Windows\System32\drivers\etc\” for editing. You will need to get the IP address of your new domain name hosting account created at the new server.This will be available under the DNS setting after you add the new domain name in your hosting account

4. Setup your domain to point to the new server by changing the nameservers and if the domain is not setup in your cpanel of the new web host ,you will have to then add it as a addon domain in your new hosting Cpanel

5. Now check that your domain is resolving to the new host by uploading a dummy page.Once the domain has resolved ,you can begin moving the wordpress site from one server to the other server.

6. Upload the site contents you have downloaded in step 1 by FTP to the new host.

7. Create a new database for your site in the new Cpanel. Create a new mysql user ( note down the password). Note down the database name and the user and it’s password.

8. Go to phpMyadmin in the Cpanel of your new server.Go to the database you just created. From the Import tab, import the mysql file that you downloaded in step 3

9. Go to your FTP client and open the already uploaded wp-config.php file ( it is at the root of the installation) for editing.Change the database name, database user, and the database password and upload the file back to the server.

10. Your site should be working on the new server now,with the same admin username and password.

Moving wordpres site to a different domain name on new server

All steps are the same. except the following is to be added to step 3.

Make a copy of the downloaded .sql file and rename it as backup.sql.Now open the .sql file in a editor such as Notepad++ and search and replace mydomain.com with newdomain.com where mydomain.com is the old domain name and newdomain.com iss the new domain name ( do not add http or www for the search and replace).Save the file

All other steps are the same.



That is all.

If you liked this article please do leave a reply and share it with friends.

Thanks.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.