Setting up and running your WordPress website is all fun and games until you decide you need a new server. This is the opinion held by many people. They imagine that moving their sites to a new host is a long and daunting process, while actually it isn’t. In this article, we will focus on steps to migrate your WordPress.com site to a new server.
If you are having problems with your wordpress.com site, it could be time to look for greener pastures. Some may choose to stay with the same sever because they fear damaging their site during the migration process. Many look for experts to help them with this task, while others acquire the services of another host. Only a few have a go at it on their own.
If you currently own a website, you probably build the site on your own. The process of moving to a new server shouldn’t be a problem if you are familiar with WordPress’ features.
Without wasting any more time, let’s have a look at the steps you need to follow to migrate your wordpress.com site to a new sever.
- Step 1: Back Up of site’s files
This is the first important step. It is akin to backing up a computer’s data when you are about to update the operating system. Although many plugins are available to help your perform this task, you need to do it manually for better results.
Connect to your web host using FileZilla (an FTP program) then copy the websites files to a folder in your PC. It is important to check the help file on the FTP program because files such as .htaccess are usually concealed. The process might take a bit longer so patience is paramount.
- Export of WordPress database
Exporting your database is a simple task. Simply open the phpMyAdmin after logging into the cPanel account of the website server. On the side bar at the left side of the screen, select the WordPress installation then click on the Export button that appears on the navigation menu.
The SQL format and the default settings of Quick Export are okay so you will proceed with the process. Next, Select the Go button and the exportation process will begin. The file will be downloaded to your PC. You will be ready to move to the next stage once the FTP file transfer and database export is complete.
- Creation of WordPress database on the new server
Before you migrate to the new host server, you must first prepare it for the WordPress installation. There has to be a database which you can import your SQL data into. You will be given user login details which you will use to access the cPanel software.
You can use MySQL databases application to complete this process. If you discover that a web host doesn’t have this application then inquire on how you can create a database.
The first step is to open MySQL Database and creating a new database. Secondly, create a new MySQL user and don’t forget to develop a strong password. Lastly, add the user account to the database and give it All Privileges.
- Editing of the wp-config.php file
Look for the folder where you downloaded your WordPress site files to. In the folder, you will see a file named wp-config.php. It is the file that controls access between your database and website.
Take a copy of the file and transfer it to another folder in your PC so that in case anything goes wrong you can still start the process. Next, use a text editor to open the original file and make the following edits.
Change the Database Name
Look for this line: define(‘DB_NAME’, ‘db_name’);
Change the db_name part of the line will have your old web host’s MySQL database name. You should change the name to that of the new database.
Change database username
The second line you will see is: define(‘DB_USER’, ‘db_user’);
The db_user part of the line will contain the username of you old web host. Change it to match the username you just created.
Change of the database password
Locate the third line: define(‘DB_PASSWORD’, ‘db_pass’);
The db_pass section of the line should be changed to the new password created for MySQL user.
After going through these three steps, save the wp-config.php file.
- Database import
Having created a database, the import process can begin. Go to the cPanel software and launch phpMyAdmin then select your new database. When it opens click on the import tab in the navigation menu. In the file to import section, click on file button and select the SQL file you had exported.
The next step is to un-tick the partial import check box while ensuring that the format is set to SQL. Lastly, click the Go button to begin the import. The time it takes to complete depends on the size of the database.
- Upload of WordPress files
Using an FTP program, connect to the new web host and look for the folder where the site will be held. Upload the files to the public_html folder. The uploaded files will include an updated wp-config.php. The process usually takes much longer. Take care not to delete the files from you PC once the upload is over.
- Defining new domain and linking to new URL
This step is important if you are moving to a new domain. If you are moving a site, you will probably discover that there are links to other posts or images pointing to a URL on the server. This usually cause a break. To replace the old domain name during the migration process, use the Search Replace DB Script.
As you go about replacing the old domain, note that you’ll also be changing the site_url and home_url in the database. This is important because it will ensure that when you login to the site on the new domain you won’t be redirected to the old domain.
Remember to reconfigure the domain’s DNS settings before you use the site on the new host. These DNS changes usually take up to 48 hours to complete. After this period everything will be set. It is advisable to hold on to the backup files and database export because you may want to reverse the migration at some point.
As you can clearly see, the process outlined above can serve any website owner-beginner or expert. You only need to ensure that you religiously follow all the steps. Keep the files on your PC just in case you think of returning to the original server.