WordPress provides a variety of different plugin tools to help you migrate your sites from one host to another.

Often a host, especially shared hosting, won't provide you with root access to the server where your sites are hosted. In these situations using one of these tools is necessitated.

In this article we are going to use the All In One WP Migration plugin to migrate a site into a GridPane server using an AIOWPM backup.

During this article we will be referring to the site you wish to migrate as the origin site and the site or server being migrated into as your destination site or server.

For this article the demo origin site I will use has a small amount of dummy content and is using the stargazer theme.

Step 1. Backup your Origin site with All In One Migration

The plugin authors, ServMask, have extensive documentation about using this plugin at their Knowledge Base. Please refer to this documentation for any use of the more advanced features of the plugin. You may also contact them for free help here.

Install and activate the All in One WP Migration plugin on your origin site. 

Once activated go to the All In One WP Migration settings Export page. This page includes a Database Find and Replace feature, and more Advanced options you can configure.

For this article we don't need any of the advanced options.

However I have set the export to replace our site title with something appropriate so we can see that the migration has been successful. I am changing the site title from AIOM Migration Source to AIOM Migration Completed.

Click the EXPORT TO hamburger menu, and select File from the dropdown menu.

A Popup modal will appear detailing progress of the export process.

Once the export is complete, you will be presented with a button to download the site backup.

Click the big green button to begin the download process.

Another modal will appear and ask you to save the file. Notice that the downloaded file has an extension of .wpress, this is the All In One WP Migration format, you must be very careful not to change this filetype.

Store the backup file somewhere safe on your local machine.

Step 2. Create the Destination GridPane site to migrate into

In your GridPane account, if you haven't already provisioned a server to host the migrated site, do so now. We have easy to follow guides with step by step instructions here.

On your destination server you can now deploy the GridPane destination site into which you will migrate the origin site, using the correct origin domain name.

We have easy to follow guides that take you step by step through the process of deploying GridPane WordPress sites here.

Once your site is provisioned and ready to be migrated into you will see it in the Active Sites panel with all icons turned Green.

Step 3. Enable a local URI redirect by editing your Hosts file

However, at the moment you can't visit your destination site as the DNS records and Name Servers for the domain are currently point to the origin hosting.

Now you need to edit your local machine's hosts  file to enable a URI redirect. This will allow you to visit your destination site from your local machine using the correct site URI. With the redirect enabled, you will see the destination site, while the rest of the internet will see the origin site.

As I am using macOS I will open my /private/etc/hosts  file for editing with the following command.

sudo nano /private/etc/hosts

We have more complete documentation regarding editing your local machine's hosts file to redirect URIs here, including instructions on the location of a hosts  file on macOS, Windows and Linux machines.

For this tutorial the active domain is an-example.com and the destination server IP address is 188.166.148.89 , so I need to add the following lines to my hosts  file.

188.166.148.89 an-example.com
188.166.148.89 www.an-example.com

Once the edited hosts  file has been saved you will be able to visit your GridPane site using the active domain.

With regards to this articles example destination site, when I visit http://an-example.com  I now see the recently deployed GridPane site and not the origin site.

Step 4. Migrate Origin Site Duplicate into Destination Site

A Note on SSL certifications and Migrations

Now we are ready to migrate our origin site from our All in One WP Migration Backup file into our destination site, but we now have several migration paths we can choose from.

The eagle eyed will have noticed that the destination site has no SSL certificate, but our origin site does.

We are unable to issue a Lets Encrypt SSL for the destination site until DNS records have been changed over to point at the GridPane server and resolve. Lets Encrypt requires the DNS records to resolve to the destination server before issuing a certificate.

If your origin site is using HTTPS too, then you have several options:

  1. Migrate the site into an HTTP site, then change Nameservers/DNS records, wait for resolution and then issue a new certificate for the migrated destination site.
  2. Put up a holding page at the destination site which will initially be served by HTTP, then change Nameservers/DNS records, wait for resolution, issue a certificate, and then migrate the site directly into an HTTPS site.
  3. If you have access to your origin site's SSL certificates you can copy them and contact GridPane support and we will install them on your server. You can migrate your site directly and then change Nameservers/DNS records.

Which option you choose will depend on your needs.

Option 1This option will lead to no downtime for the site, but there will be a short period during which the site will be served over HTTP once the DNS changes have resolved prior to the new SSL certificate being issued.

If HTTPS is not crucial for the functioning of your site, then Option 1 is probably best. Your migrated site will be served for a short period without an SSL, but there will be no downtime for your users.

Option 2This option will lead to a 'maintenance' period for your site during which your holding page will be served. It will initially be served by HTTP until the DNS changes resolve, at which time you will be able to issue a new SSL certificate. The holding page will now be served by HTTPS until you are able to complete migration.

If HTTPS is crucial for the functioning of your site, for example if your site has some form of eCommerce functionality, then Option 2 is definitely best. There will be a brief period during which your site is unavailable, but at no point will your real site be serving users without the protection of an SSL certificate

Option 3This option is the best option if possible, however on most shared hosting it is not possible to copy your Let's Encrypt SSL certificates. If however you are using paid certificates, then these belong to you. If that is the case export your SSL certificates and contact GridPane support to assist in your migration. Once you have your SSL certificates installed, follow the instructions of Option 1.

Please select which option pathway you require and scroll down to the relevant instructions.

----------------------------------------------------------------------------------------------------------------------

Option 1 - Migrate into HTTP then change DNS and enable SSL

Import the All in One Migration Backup in to your Destination Site.

Install the All in One Migration Backup plugin on your GridPane destination site and activate it. Once activated, go to the All in One WP Migration Import settings page and click the IMPORT FROM hamburger in the middle of the IMPORT SITE panel.

A dropdown menu will appear, select FILE

Now select the All In One WP Migration backup .wpress file you saved to your local machine in Step 1, and click Open.

A popup modal will appear displaying the progress of the upload process, this may take some time depending on the size of the origin site being migrated and your internet connection.

Once the upload is complete, the modal will be replaced with a warning notifiying you that the existing site, including all files, plugins, themes, and the database will be overwritten by the migration. You will need to click Proceed.

Once the migration is completed and your data has been imported successfully, the popup modal will notify you of the need to reset your permalinks before your migrated site can be viewed correctly.

Click the Permalinks Settings link.

You will be automatically logged out. This is because your GridPane destination site Admin User was deleted when the database was overwritten. You will need to log back in using the Admin User from the origin site.

On the Permalinks Settings page, don't touch any of the settings, but click save twice.

Test your duplicate site

Your site has now been successfully migrated to an HTTP site. You should now test your site thoroughly, both from the admin screens and the front end. Ensure your content and options have all been migrated correctly.

Next we will enable HTTPS.

Update DNS records and changeover Nameservers

We are now ready to change our Nameservers/DNS records and point the internet to our newly migrated site.

In your DNS providers settings make sure you have the correct A and CNAME records set for your primary root domain and the www host.

(some people prefer to set www as an A record, both are fine.)

Make a note of your Nameservers, your provider will have documentation to help you find these.

You are now ready to change the Nameservers for the site domain at the Domain Registrar. Each Domain Registrar has a unique control panel, though they all share similarities, as such it is impossible to give instructions for each one, however the links below might help.

Links to articles for some of the most popular domain registrars:

Wait for DNS Changes to resolve and propagate.

Let's encrypt will not be able to issue an SSL certificate for you until your DNS changes have resolved.

It can take up to 48 Hours for DNS changes to fully resolve, however as long as you are using a high quality DNS service it is usually only 5-15 minutes until your changes have resolved enough for the SSL issuance to be successful.

There are many tools you can use to keep an eye on the progress of your DNS change resolution. One option is DNS Checker.

It is usually possible to issue an SSL certificate when one of these tools is showing most of their resolution checks are pointing to the destination server.

Enable an SSL certificate on your destination site.

Once your DNS changes have resolved, you can enable an SSL certificate for your destination site.

In your GridPane control panel, open the site customizer by clicking on your destination site name in the Active Sites list.

First make sure that all Caching is disabled.

Next click the SSL toggle to add an SSL certificate for your migrated site.

Now you should remove the Hosts redirect you added in Step 3 above. You will want to visit your site using the correct DNS records to test it in Step 5.

-----------------------------------------------------------------------------------------------------------------------------

Option 2 - Enable SSL on Maintenance site and then Migrate

Turn off site caching

In your GridPane control panel, open the site customizer by clicking on your destination site name in the Active Sites list.

First make sure that all Caching is disabled.

Install a Maintenance Holding Page

On your local machine create a basic Maintenance holding page and name it index_holding.phpUsing your favourite SFTP client upload this file to the root directory of your destination site. To ensure there are no permissions errors it is best to upload the files using the system user that owns the destination site.We have an easy to follow article that details the process of connecting to your GridPane sites by SFTP as a system user here.

Next, using your SFTP client, change the name of the original WordPress index.php file to index_wordpress.php.

Before changing the name of index_holding.php to index.php.

Now you have swapped out your WordPress index page for a maintenance page, when you visit your site you will see the holding page.

It currently has no SSL certificate enabled, but we are now ready to swap Nameservers and change that.

Update DNS records and changeover Nameservers

Now our holding page is live we are ready to change our Nameservers/DNS records and point the internet to our newly migrated site.

In your DNS providers settings make sure you have the correct A and CNAME records set for your primary root domain and the www host.

(some people prefer to set www as an A record, both are fine.)

Make a note of your Nameservers, your provider will have documentation to help you find these.

You are now ready to change the Nameservers for the site domain at the Domain Registrar. Each Domain Registrar has a unique control panel, though they all share similarities, as such it is impossible to give instructions for each one, however the links below might help.

Links to articles for some of the most popular domain registrars:

Wait for DNS Changes to resolve and propagate.

Let's encrypt will not be able to issue an SSL certificate for you until your DNS changes have resolved.

It can take up to 48 Hours for DNS changes to fully resolve, however as long as you are using a high quality DNS service it is usually only 5-15 minutes until your changes have resolved enough for the SSL issuance to be successful.

There are many tools you can use to keep an eye on the progress of your DNS change resolution. One option is DNS Checker.

It is usually possible to issue an SSL certificate when one of these tools is showing most of their resolution checks are pointing to the destination server.

Enable an SSL certificate on your Destination Holding Page.

Now the DNS changes have resolved, we can enable an SSL certificate for the destination site.

In your GridPane control panel, open the site customizer by clicking on your destination site name in the Active Sites list.

Next click the SSL toggle to add an SSL certificate for your migrated site.

Now you should remove the Hosts redirect you added in Step 3 above. You will want to visit your site using the correct DNS records to test it.

You should now be able to visit your domain and view your holding page by HTTPS at

https://an-example.com

Now your Holding site has an SSL certificate enabled, we can migrate your origin WordPress site into it.

Import the All in One Migration Backup in to your Destination Site.

Install the All in One Migration Backup plugin on your GridPane destination site and activate it. Once activated, go to the All in One WP Migration Import settings page and click the IMPORT FROM hamburger in the middle of the IMPORT SITE panel.

A dropdown menu will appear, select FILE

Now select the All In One WP Migration backup .wpress file you saved to your local machine in Step 1, and click Open.

A popup modal will appear displaying the progress of the upload process, this may take some time depending on the size of the origin site being migrated and your internet connection.

Once the upload is complete, the modal will be replaced with a warning notifiying you that the existing site, including all files, plugins, themes, and the database will be overwritten by the migration. You will need to click Proceed.

Once the migration is completed and your data has been imported successfully, the popup modal will notify you of the need to reset your permalinks before your migrated site can be viewed correctly.

Click the Permalinks Settings link.

You will be automatically logged out. This is because your GridPane destination site Admin User was deleted when the database was overwritten. You will need to log back in using the Admin User from the origin site.

On the Permalinks Settings page, don't touch any of the settings, but click save twice.

Now you have successfully imported your origin site into your HTTPS destination site all that is left is to test it in Step 5.

------------------------------------------------------------------------------------------------

Option 3 - Copy origin SSL certificates and migrate to HTTPS

With this option you will need to export your SSL certificates from your origin host, and contact GridPane.

We will add your certificates to your server and make the correct Nginx configuration changes.

Following this, the process will follow the same path as Option 1.

Step 5. Visit your Site and Test it - Finished.

No matter which option you chose for your migration in Step 4, you are now ready to visit your site and test it.

For my example I will visit:

https://an-example.com

And proceed to browse my content and check my console looking for an errors.




Did this answer your question?