In this tutorial, I am going to show you how to move a live WordPress site to a local server. Moving a live WordPress site to a local server can be very useful to make changes to your website while keeping your website accessible for your audience. It allows you to add new features, implement a new design and do proper testing before going live and potentially impeding user experience.
For this tutorial, I use the Duplicator plugin, which is available for free from the WordPress repository. The Duplicator plugin makes it very easy to copy your WordPress installation and move your site to another hosting account or in this case, a local host.
So let’s get started! Please note that you need to have a local server setup for this tutorial to work, for more information refer to this post. You can check out the video I included below or follow the written steps in this post. Good luck and let me know if you have any questions.
#1 Install Duplicator Plugin
Open your dashboard of your hosted WordPress site and add a new plugin. Search in the repository for the Duplicator plugin (by LifeInTheGrid). Install and activate the plugin.
#2 Create a Duplicator package
In the toolbar on the left click the Duplicator plugin and now click ‘Create New’.
Use all the default settings and click next. Now the plugin will scan your site for potential problems. Follow up on potential warnings. If you are getting the large file warning then don’t worry, this does not cause any problems in most cases.
If you received warnings and you have followed up on them, tick the box to continue. Now choose build.
It can take a few minutes depending on how large your site is for the package to finish. Once the package is finished you will be given an option to download an installer file and the archive package. Download both of them.
#3 Create a database and folder
If you open MAMP you can select the option ‘Open WebStart Page’, click this.
This should take you to the dashboard of MAMP on your local host. In the toolbar on the top, you can see the option: tools, select phpMyAdmin.
Once you are in phpMyAdmin, click Databases and enter the name of the database you want to create. It is suggested to choose a name that would be easy to recognize later on. So for this website that would be: tropicalup.
Next step is that we are going to have to create a folder that will contain our website. On the MAMP start screen choose ‘Preferences’. If you click the tab web server you will see the location of folders of you offline installations.
As you can see above this is ‘htdocs’, if you click the arrow you will be automatically taken to this folder location.
Tip: If you plan to have more local websites in the future, bookmark this folder for easy access.
Within the folder ‘htdocs’ we will create a new folder, this will be the name of your website and ideally would match the domain name of your live hosted site. So for this website, I would create a folder ‘tropicalup’ that also matches the database we created earlier.
#4 Copy Installer and Archive to folder
Now that we have created a database and a folder we are going to copy the installer and the archive that we created with the duplicator plugin. Don’t unpack the archive file and make sure that the folder you copy them into is empty.
#5 Run the Installer
Next thing to do is to run the installer. Go to your localhost and navigate to the folder where you put the installer and the archive file.
Click the Installer and be sure to select ‘Create a new database’.
Name: the name of the database you specified in step 3.
Test the connection to be sure that you are able to connect to the database or else you won’t be able to proceed with the installation.
Tick to box to accept the warnings and proceed with the installation.
Check to be sure that the installation is in the root folder, (e.g. tropicalup, opposed to tropicalup/WordPress or something like that).
Now click Run Update.
Wait for the Installer to finish.
#6 Save the permalinks and check your site
After the installer is finished, ensure that you have not received any errors. When this is the case we will update the permalinks.
Click ‘Save Permalinks’ and log in on your WordPress site on your localhost with your login credentials.
Now under the page click ‘Save Changes’.
Now click ‘Take me to the cleanup page!’. Click ‘Delete reserved files’.
Check if you site functions properly.
Important: If you have a caching plugin installed on your WordPress you might receive an internal server error 500 when you are trying to make changes to pages or posts. This is usually in a PHP file that returns an error. If this happens deactivate your cache plugin and your site will function normally.
Congratulations you have successfully moved your hosted WordPress site to a local host. If you have any questions or run into any problems let me know in the comments below!