Documentation / Setting up Staatic / Preparation

Preparation

Introduction

In order to start using Staatic to power up your site, some preparations are necessary. This guide will cover them step by step.

Migrate WordPress

Since your existing WordPress site will be replaced by a static version of your site generated by Staatic, you will need to move your current (dynamic) WordPress installation to another location.

To migrate your WordPress installation to the new location, instead of moving everything, we recommend making a clone of your site. This will allow for an almost zero downtime migration without the risk of loosing important data.

There are many WordPress plugins that can help you with this. One plugin that we have good experiences with is Duplicator, but any other should work fine as well.

This guide will explain the steps necessary to migrate your WordPress installation to another location using the popular WordPress migration plugin Duplicator.

Note: If you have a Multisite installation of WordPress and want to migrate all sites at once using Duplicator, this requires Duplicator Pro which is not free.

We will be assuming that you have your WordPress installation setup on “www.mysite.com“, and you are going to migrate it to “wordpress.mysite.com“, making it possible to use www.mysite.com for the static version of your site.

We will also be assuming that you have administrator access for both locations.

1. Preparing the new location

Before starting with the migration process, make sure that the new location to host your WordPress installation is setup.

Preparing the domain

Make sure that the (sub)domain (“wordpress.mysite.com”) is created on your server and accessible.

Note: This is a great moment to restrict access to the new location to prevent anyone from accessing the cloned WordPress installation.

Preparing the database

Since we will be cloning your current WordPress installation to the new location, a new (empty) database will need to be created as well. Note the database details since we will need these when creating the clone.

2. Create Duplicator Package

The first thing we will need to do is to install the Duplicator migration plugin on your current WordPress installation.

  1. From the Dashboard, click Plugins > Add New.
  2. In the Search field, enter Duplicator and choose Duplicator – WordPress Migration Plugin to install.
  3. After installation click Activate.

After the plugin is activated, a Duplicator menu item will be added within your WordPress admin. Click on the Duplicator menu, and then click on the create button to create a new package.

This will start the Website Duplicator Wizard and immediately run some tests to verify whether everything is in order. Review the System Scan result and everything is okay click the Build button at the bottom.

Duplicator will now start creating a package of your WordPress installation which may take a few minutes depending on the site of your site.

After the package has been built, download both the Installer and Archive file which will be needed later. The archive file contains your complete WordPress site and the installer file allows you to extract the archive on the new location.

3. Extracting Duplicator Package

In order to extract the duplicator package on the new location, you will need to upload both the Installer and Archive files created earlier to the new location of your WordPress installation.

Once uploaded, within your Browser access the installer:

https://wordpress.mysite.com/installer.php

This will present the Duplicator migration wizard.

The Archive should be recognized and if validated correctly check the checkbox to accept the terms & notices and click on Next to continue.

The installer will now ask you for the database details. Enter the details of the new database that you created earlier and click on Next to continue.

Duplicator will now extract all of the files and database tables on the new location using the uploaded Archive file.

On the next step Duplicator will allow you to change some setting on the cloned WordPress installation. Verify that the new URL matches the URL of the new location (in this case https://wordpress.mysite.com) and keep the rest the same. Then click on Next to continue.

When Duplicator finishes the migration you can login to your cloned WordPress installation.

Note: Make sure to delete both the Archive and Installer files after finishing to prevent anyone from downloading a complete copy of your site.

The original WordPress installation on your public facing site (www.mysite.com) will later be replaced by the static version of your site. For now it is best to leave it as it is.

Restrict access to WordPress

It is important to prevent the WordPress version of your site from being publicly accessible as that would cause duplicate content and be less secure.

The easiest way to accomplish this is by using HTTP basic authentication. Another way is to restrict access to the site based on the visitor’s IP addresses. In that case do make sure that the server’s IP address is allowed since our plugin needs to be able to access the site as well.

Setting up HTTP basic authentication

Setting up HTTP basic authentication differs depending on your specific hosting environment.

We have collected the following resources to help you.

Determine deployment strategy

Staatic allows you to publish your static site to the same server that hosts your WordPress installation, as well as on any of the supported cloud providers.

Depending on the deployment strategy that you choose additional preparation might be needed. Please check the documentation of the chosen deployment method for more information.