Find Colocation, Dedicated Servers & Cloud Hosting:
Call Now (888) 400-5732

Migrating WordPress Installs to a New Collocated Server with cPanel

Posted by QuoteColo on June 30, 2016 - Updated on February 20, 2023

Picture16Having a website is a vital consideration for any business today. You simply cannot afford to be without one – your competition has a website, you can bet. Your customers are also searching for you online. Once you’ve chosen a host and gotten your website up and running, it might seem like you’re in the clear, but what happens when you need to change hosts? If you’re using WordPress (like so many businesses do), and you’re moving to a new collocated server with cPanel, the migration process is actually relatively straightforward. Here’s what you need to know.

  1. Lock the site. If your site is live, make sure you lock or freeze it before you do anything else. This will ensure that no changes can happen to the site while you’re working behind the scenes. Maintenance mode plugins can help you do this and lock things down. WB Migrate DB is a good one, and it can be combined with BackUp WordPress. Note that you should have access to your cPanel account with the right login information. You’ll also need SSH access to that account.
  1. Get the new site live. Once the old site is frozen, you need to get the new site ready for action. The best way to do this is to start with a clean WordPress install. You’ll need to create a database on the new site, and then install WordPress.
  1. Once WordPress migration is installed, install and activate both of the plugins mentioned above.
  1. In WP Migrate DB in the Tools menu on the site, get the values for current address (URL) and the current file path. Save this information. You’ll need it later.
  1. Go back to your old site and install both plugins, and activate them. You’ll need to configure BackUp WordPress.
  1. Run BackUp WordPress from the Tools menu, and then download the zip file it creates. Save this file on your PC. This is your backup file of the unchanged old site. As a note, make sure that the database is included.
  1. Make sure that WordPress is completely updated on the new site, and that you’ve downloaded all the upgrades and patches currently available.
  2. Picture17Deactivate your security plugins, as well as any cache plugins running on the site, as these can interfere with the process
  1. Run BackUp WordPress again (you don’t need to include the database this time), and save it to your computer.
  1. With the backup in hand (or on your drive, rather), it’s time to move the site. Run WP Migrate DB from the Tools menu, and make sure that the values are the same as those you saved back in step 4. These should be plugged into the new address (URL) and the new file path sections. Make sure to save the output on your computer somewhere.
  1. Take the backup file that you created in step 9 and unzip it.
  1. Edit wp-config.php and change the DB-NAME, DB_USER, DB_PASSWORD and dB_HOST to the values for the new website. These can be found in the wp-config.php file for your new website before you upload the information from the old site.
  1. Check the .htaccess file to find out if it includes rules that pertain to the old site. If there are any, you’ll need to modify them so they reflect the new site, or you’ll need to remove them completely. One way to do this is to save a copy from the old site, but delete it before being uploaded. Add various sections of it back in when necessary. As a note, it’s fine to remove lines between # BEGIN WordPress and # END WordPress. Those lines will be recreated by the program, but you might need to assign permalinks to default and then back to the current assignment to trigger the recreation process.
  1. Use either FTP or SCP to upload the second backup you made of the old site. Note that this will automatically overwrite the previous installation of WordPress. Also note that if the WP versions are the same, you can delete the wp-admin and wp-include folders from the old site’s backup. This will reduce the amount of time needed to upload the files. With that being said, it’s safer just to leave them in case there’s an unknown discrepancy between the versions (maybe you forgot to apply an update).
  1. Once the files are uploaded, copy them from the backup to /home/your account name/public_html/*.
  1. You’ll need your cPanel credentials for the next step. Use them to log into cPanel and then run WP Migrate DB. Note that if an error occurs, go to permalinks, under Admin and Settings, and then save changes. There won’t be any changes to save, but this action can help get around any problems. If it doesn’t work, one of the URLs used when exporting your database might be wrong.
  1. Now it’s time to reactivate your plugins (the security and cache plugins deactivated earlier in the process).
  1. Your site should be ready to run now with any luck.

Once you’ve migrated to the new server, things should go back to normal and the website should run as usual. If you have any problems, you may need to work with an engineer to ferret out the underlying issue and correct it. If you’re not completely confident that you can migrate your site from the old server to the new one, it’s generally best to have a professional do it for you to ensure that everything goes according to plan and to prevent potential data loss or serious errors. With that being said, migrating to a new server isn’t that complicated, and the guide above should provide you with the information needed to pull it off.

Categories: Web Hosting

What Do You Think?