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 Duplicator plugin to migrate a site into a GridPane server using a Duplicator backup.

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

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 Duplicator

The plugin authors, SnapCreek, have extensive documentation about using this plugin on their website. Please refer to this documentation for any use of the more advanced features of the plugin, or if you are subscribed as a pro user of the tool.

Install and activate the Duplicator plugin on your origin site. 


Once activated go to the Duplicator Packages settings page, then click the Create New button to start the process of building your site duplicate.

There are several package configuration options; for the type of storage, what to archive and settings for the installer. You can understand more about these advanced features in the SnapCreek documentation linked to above.

In this article we will be using all the default settings, with only minor adjustments, during the installation of the duplicate, to suit our needs.

On the Packages >> New page click Next.

Duplicator will now scan your site for any issues that will cause problems during the build of the duplicate.

The scan might throw up some issues. For any issues you may refer to the solutions provided in the plugin or follow the links to relevant documentation.

One common issue would be images or files in your uploads folder that are too large and may cause problems during their compression. Other common issues include inadequate PHP settings on your origin site hosting server that might cause issues, for example a low max_execution_time in your php.ini file.

With regards to problems such as large files in your uploads folder, you can go back to the package configuration and omit such files from the archive and then transfer them by SFTP later.

With regards to problems such as inadequate PHP settings, you will need to speak to follow the documentation for your origin site hosting provider to make the necessary adjustments to your php.ini settings. This may or may not entail speaking to their support.

With the completed scan returning all checks as Good, you can now click Build.

Duplicator will build your packages, this may take from a few moments to a few minutes, depending on the size of your site and database.

Once the build has completed the Build Status panel will present you with two download buttons, one for the Installer file and one for the Archive file. Click each button to download them files to your local machine. I usually download the files to a directory on my desktop for easy management and upload in the later step.

You have now created an origin site duplicate which you can use to migrate your origin site into your destination site.

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 duplicate 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 1
This 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 2
This 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 3
This 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

Install the Duplicator origin copy into your destination site.

Using your favourite SFTP client upload the Duplicator Archive and Installer from Step 1 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.

Remember GridPane sites store the WordPress application files within an htdocs directory. So if your domain is an-example.com  then the path to this directory will be as follows.

/sites/an-example.com/htdocs

Install your Duplicate 

Once both the Archive and Installer files have been uploaded you need to visit the installer file in your browser (as long as your hosts redirect is active). In the tutorials example that would be the following.

http://an-example.com/installer.php


You will see the Duplicator installer page which will take you through 4 steps.

Step 1 validates your archive file and check your server and directory before unzipping the archive and deploying the files.

Assuming you pass validation, you must check the terms and conditions before clicking the Next button.

The next Duplicator step is to install your origin database into the destination database.

To complete these details you will need to get your GridPane site database credentials from your site's wp-config.php file. We have an easy to follow guide to show you how to display your sites WordPress configuration file here.

Once you have your Database credentials, enter them into the respective fields and click Test Database to test your Database Connection.

If your credentials have been entered correctly you will receive a green success notification, you can now click Next to install your database.

The third Duplicator step updates your database. In this step the tool searches and replaces for any urls that need updating, and makes sure they match your new server configurations.

You can see that I am choosing to keep the URL as HTTP. I have also updated the title to reflect the migration status, purely for illustrative purposes with regards this article.

Click Next to update the Database.

Once the update has been completed successfully you will be presented with a screen that instructs you to login to your newly migrated site and deleted the leftover installer files and logs, this is important for security reasons.

Delete leftover files from your destination root directory

Login to your site.

Note.
Remember, to login you will need to use the Admin user credentials from your origin site. We advise you to change these to match either the GridPane Default WP Admin User settings, or the randomly generated Admin user settings that GridPane initially provided you. This way your log settings will match your sites active Admin user.

Follow the instructions to delete the leftover Duplicator files.

Duplicator will also have copied a wp-config.php file into your sites /sites/htdocs directory.

GridPane is configured to use a WordPress configuration file in the directory /sites directory one level above, so this duplicate configuration file is not required. You should make a note of any configurations you require from this file, update your GridPane configuration file accordingly, and then delete this unnecessary file.

Test your duplicate 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.

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.

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.


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

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.php

Using 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.

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.

Upload the Duplicator Archive and Installer to your Destination site directory

Using your favourite SFTP client upload the Duplicator Archive and Installer from Step 1 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.

Remember GridPane sites store the WordPress application files within an htdocs directory. So if your domain is an-example.com  then the path to this directory will be as follows.

/sites/an-example.com/htdocs

Install your Duplicate 

Once both the Archive and Installer files have been uploaded you need to visit the installer file in your browser (as long as your hosts redirect is active). In the tutorials example that would be the following.

https://an-example.com/installer.php

You will see the Duplicator installer page which will take you through 4 steps.

Step 1 validates your archive file and check your server and directory before unzipping the archive and deploying the files.

Assuming you pass validation, you must check the terms and conditions before clicking the Next button.

The next Duplicator step is to install your origin database into the destination database.

To complete these details you will need to get your GridPane site database credentials from your site's wp-config.php file. We have an easy to follow guide to show you how to display your sites WordPress configuration file here.

Once you have your Database credentials, enter them into the respective fields and click Test Database to test your Database Connection.

If your credentials have been entered correctly you will receive a green success notification, you can now click Next to install your database.

The third Duplicator step updates your database. In this step the tool searches and replaces for any urls that need updating, and makes sure they match your new server configurations.

Make sure the URL is set to the correct HTTPS domain. I have also updated the title to reflect the migration status, purely for illustrative purposes with regards this article.

Click Next to update the Database.

Once the update has been completed successfully you will be presented with a screen that instructs you to login to your newly migrated site and deleted the leftover installer files and logs, this is important for security reasons.

Delete leftover files from your destination root directory

Login to your site.

Note.Remember, to login you will need to use the Admin user credentials from your origin site. We advise you to change these to match either the GridPane Default WP Admin User settings, or the randomly generated Admin user settings that GridPane initially provided you. This way your log settings will match your sites active Admin user.Follow the instructions to delete the leftover Duplicator files.

Duplicator will also have copied a wp-config.php file into your sites /sites/htdocs directory.

GridPane is configured to use a WordPress configuration file in the directory /sites directory one level above, so this duplicate configuration file is not required. You should make a note of any configurations you require from this file, update your GridPane configuration file accordingly, and then delete this unnecessary file.

The migration is complete, you can move on to Step 5 and test it.

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

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.

The only difference is when you update the database during the Duplicator install, you will use HTTPS instead of HTTP.

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?