How to Move a WordPress Site to Localhost

Installing WordPress on a PC (local host) allows you to learn WordPress easily. At the point when you move a WordPress site to a local host, it allows you to test the copy on your PC without making any changes to the original site, make the necessary changes, and restore it if required, replace the original site. This article will show you how to move a WordPress site to localhost.

Why and Who Wants to Move a WordPress Site to a Local Server?

You may have to test a new module or theme for your website. However, this practice isn’t appropriate when users are using the site.

To avoid this issue, many users create a copy of their WordPress website on a local server to test another theme, modules, or test improvement.

With this, you can set up your theme with all its content and test all the features without stressing over causing issues on the site. Many users copy the site to a local server to practice WordPress and coding with real site data.

Although you can do all the testing with sham content in WordPress, real site data will provide a superior visual representation of how these changes will appear on the site.

Preparing to Transfer the WordPress Site to Localhost

To start with, you want to ensure that you always back up your WordPress website. There are several great WordPress backup modules that you can use.

You want to install a local server environment on your PC. You can use WAMP for Windows and MAMP for Mac. After setting up the environment, you want to create another database using phpMyAdmin.

To start phpMyAdmin, simply use the accompanying URL.

  • http://localhost/phpmyadmin/
  • http://localhost:8080/phpmyadmin/

From here, you really want to click on the “Databases” tab and create another database. You will require this database to extract site data. Now you are ready to transfer your WordPress site to your local server.

Transferring a WordPress Site to Localhost Using a Plugin Duplicator

It is the easiest way to transfer the site.

The primary thing you really want to do is install and activate the Duplicator module.

Duplicator allows you to create a copy of a website easily. It tends to be used to move your WordPress site to another location and can also be used as a backup module.

Once activated, this module will add a new “Duplicator” thing to your WordPress admin sidebar. Clicking on it will take you to the module packages page.

You should click on the create new package button to create another package. Duplicator will start packing, and you want to click the Next button to continue.

The module will then actually look at your website and play out some background checks. Then it will show you a summary of them. If everything looks great, click the “Form” button to continue.

Duplicator has now created a pack of your site.

Extract and Install Duplicator

You will see a compressed file containing all the website data and an installation file. You want to download the two files to your PC.

Now you are ready to package and install these files on your local server.

First, you want to create another folder in your local server root folder. Here your local server stores all websites.

For example, if you use MAMP, the folder will be/Applications/MAMP/htdocs/. If you are using WAMP, the folder will be C:\wamp\www\.

Inside this folder, you can create new folders for each new website you want to import or create on your local server.

After that, you really want to open the folder you created for your local website and then copy and paste both the compressed file and the installer script you downloaded earlier.

To run the installation, you really want to open the installer.php script in your internet browser.

For example, if you put the two files in the/mylocalsite/folder, you can access them in your program by visiting http://localhost/mylocalsite/installer.php.

You will now see the Duplicator installation script like this.

Click the next button to continue.

Duplicator will now open the compressed file and ask you to enter your local site database information. This is the database you created earlier.

The server name is always localhost, and the username is root. Your local server installation often doesn’t have a password set for root, so you can leave it blank.

At the bottom of the page, you will see the “Test Database” button, which you can use to ensure your database information is right.

Click on the “next” button to continue.

Duplicator will now import your WordPress database. After that, it will ask you to twofold check the new website information it automatically distinguished.

Click the next button to continue.

Duplicator will now finish the arrangement and show you a button to log in to your local site. You will use the same WordPress username and password that you use on your site.

You have effectively moved your site to the local server.

You may also like...

Leave a Reply

Your email address will not be published.