+

How to create a local copy of your WordPress website

Making changes to a live WordPress website can be risky. In this post I show you how to create a local copy of your WordPress website so you can test out changes before you make them live.

Making changes to a live WordPress website is risky.

Something as small as a missing semi-colon, a new line of code or a dodgy plugin could break your entire website!

This is why I recommend that you create a local copy of your website to test changes on before carrying them out on a live website. A local copy of your website will run offline on your computer, and it provides an easy and safe way to play around with your website and its files.

Once you have a local copy of your WordPress website set up you can edit the code and install plugins to your heart’s content without the risk of breaking your live website.

This is particularly great if you are preparing for the arrival of Gutenberg and you want to test out the compatibility of your theme and plugins with the Gutenberg editor.

In this post, I’m going to show you how to create a local copy of your live WordPress website.


1 | Download and install Local by Flywheel

First things first, you will need to set up a local development environment where you can set up local WordPress websites.

I personally use a free tool called Local by Flywheel and this is what I am going to be using throughout this tutorial.

Start by heading over to the Local by Flywheel website. The homepage looks like this:

Local by Flywheel homepage | HollyPryce.com

On the homepage, click Free Download.

This will open a pop-up where you should select the platform you are using (Windows or Mac) and enter your details.

When you are ready, click Get it now! to start the download.

Local by Flywheel download | HollyPryce.com

Once Local by Flywheel has finished downloading, click on the file to begin the installation. You may be prompted to allow changes to your computer throughout this process.

Eventually, you will see a screen that looks like this:

Local by Flywheel installation | HollyPryce.com

All you need to do here is click Let’s Go! and wait for the installation to run.

While you are waiting for it to install, move on to the next step…

2 | Install the Duplicator plugin

While there are various ways in which you can export your content from your live WordPress website, I’ve found the easiest way is using the Duplicator plugin.

If you aren’t familiar with Duplicator then basically it is used to create “packages” that contain a copy of your WordPress files and the database that your website runs on. Duplicator can be used to move your website from one host to another, but it also provides an easy way to make a copy of your content so that you can create a local version of your website.

To install the Duplicator plugin hover over Plugins in the left-hand menu and click Add New.

Add new plugin in WordPress | HollyPryce.com

Then use the search form on the plugins page to search for Duplicator. It looks like this:

Duplicator for WordPress | HollyPryce.com

Click Install Now and then when prompted to, click Activate.

3 | Create a package using the Duplicator plugin

Once you have activated Duplicator you will see a new item in the left-hand menu of WordPress called Duplicator. Hover over this and click Packages.

Duplicator in WordPress | HollyPryce.com

In Duplicator you create packages which are essentially just backups of your website. These packages also come with an installer file which is used when you are moving hosts.

To create a new package, click Create New.

Duplicator package builder | HollyPryce.com

The first step in the process is to set up your package. Start by giving it a suitable name. I recommend leaving all the other settings as they are.

Click Next when you are ready to move on to the next step.

Duplicator package builder | HollyPryce.com

Duplicator will now run a test to make sure it is ready to export your website content.

Hopefully, you will see lots of green boxes that say “Good” like in the image below. If you do see this then click Build to move on to the next step.

Duplicator package builder | HollyPryce.com

If you have any “Notice” warnings, like in the image below, it’s worth taking a look at these to see what you can do to fix them. Sometimes Duplicator will not be able to make a copy of your website if there are issues.

In this example, some of the media files were too large and there was an issue with the caching plugin I was using.

If you want to continue regardless of the warnings, tick the box next to Yes. Continue with the build process! and then click Build.

Duplicator package builder | HollyPryce.com

Duplicator will then begin building your package. This might take some time.

Once it is complete you will see the Package Completed confirmation page. As you will see there are two files to download. The first in the installer file that I mentioned before and the second is the archive which is the backup of your website. The archive file in a compressed zip folder.

Duplicator package builder | HollyPryce.com

You only need to download the achieve file. This may take some time, depending on the size of your website files.

4 | Drag and drop your archive file into Local by Flywheel

Once the archive file has finished downloading, open up Local by Flywheel.

Instead of creating a new local website, you need to drag and drop your archive zip folder (the one you just downloaded from your website) into the Local by Flywheel interface. It could not be simpler!

Importing site from archive into Local by Flywheel | HollyPryce.com

Hopefully, you should then see a page that says Import site from archive. Here you can choose the name for your local site. By default, it will just use the name that Duplicator gives to the file, so you will probably want to change it to something shorter!

When you’re done click Continue.

Importing site from archive into Local by Flywheel | HollyPryce.com

Then you will be prompted to choose your environment settings. I recommend leaving this as Preferred.

Now click Import Site.

Local by Flywheel preferred settings | HollyPryce.com

Local by Flywheel will now work its magic and it will import your WordPress files and database. This may take some time, but don’t close down Local by Flywheel during this importing phase.

5 | Test your local website

When the archive file has been imported into Local by Flywheel, click View Site to preview your website.

View WordPress website in Local by Flywheel | HollyPryce.com

If the process has worked you will see your local website but it will look exactly like your live website. Take a look at the URL and you will see it is different from the URL of your live website.

You can also view your WordPress admin area by clicking Admin.

View WordPress admin area in Local by Flywheel | HollyPryce.com

Again, notice how the URL is different but how everything looks the exactly the same as your live website.

Of course, any changes you make here will not impact on your live website.

If your live website runs on https…

If your live WordPress website runs on https rather than http, you will see a banner at the top of Local by Flywheel that says “Heads-up! Your site is using HTTPS but the Local SSL certificate isn’t trusted”. To fix this, simply click Trust. Then when you view your local website, you will see it runs of https and you don’t get any warnings about the page not being secure.

Trust SSL certificate in Local by Flywheel | HollyPryce.com

Alternatively, if you don’t see this banner at the top of Local by Flywheel, click on the SSL tab and then click Trust.

Trust SSL certificate in Local by Flywheel | HollyPryce.com

Pin for later?