» » » How to Move WordPress to a New Host

How to Move WordPress to a New Host

posted in: WordPress
2 min read

There are two ways that you can move the WordPress website to the new host. One is using the plugins and another is using PhpMyAdmin or other MySQL interface application. I gonna talk about moving the site without the plugins. I assume that you already have the new domain name or using the current domain name. Also, you already have the new host login (cPanel).

InterServer Web Hosting and VPS

 

Here are the steps we will do.

  • Export the database from the phpmyadmin at the current host
  • Create a new database at the new host
  • Import the imported database into the new host
  • Now changing the domain name at the new database via phpmyadmin
    • For Single site
      • wp_options table, find the option_name fields below:
        • siteurl => https://domain-name.com
        • home => https://domain-name.com
    • For Multi-sites
      • wp_options table, find the option_name fields below:
        • siteurl => https://domain-name.com
        • home => https://domain-name.com
      • wp_n_options table, find the option_name fields below (n is the number of mini-sites):
        • siteurl => https://domain-name.com
        • home => https://domain-name.com
      • wp_blogs table, find the domain field and change it to your domain name without http:// or https://
      • wp_site table, find the domain field and change it to your domain name without http:// or https://
      • wp_sitemeta, find the meta_key field and change it to your domain name with http:// or https://
  • Transfer all WordPress files from the current host to the new host
  • At the new host, visiting the WP login at https://example.com/wp-login.php
  • Log in and go to Settings then Permalinks and just save it without any changes in order to flush the URL for the site on the new host
  • Now your site should work on the new host

 

GUID

The method above, the GUID won’t change to a new domain name if the domain name is different from the old site. To fix it, you should migrate the database using the plugins instead of export and import the database directly. I often use the WP Migrate DB plugin.

 

Migration with the plugin

If you don’t feel comfortable with the manual migration, you can follow this article.