How can we move WordPress live site to local server?

Once if you start installing WordPress, you will automatically become an expert in WordPress and so, other things like testing will be at fingertips. Some users are not aware of moving a WordPress live website into a server locally. No changes will happen if you move your WordPress live website into the server locally. The data access is the same even if WordPress's live website changed into a local server.

It is a must that you should have a valid reason for this change. So, let us start analyzing the reason for the local server movement.

If you want to change the plugin or themes in the WordPress website then don’t try it on your live website. It may result in a very bad user experience, especially for your customers. So, try by creating a copy website in your local server so that, it would be easy for you to test a few things like development, plugin, and themes.

Do a feature test and start setting up the themes as usual. No need to worry about the website breaking point. It never happens on your website!!!

Apart from this, some users will wontedly copy their website for practicing codings and testings. That’s it! Preview your changes in the live website after doing changes in WordPress live website.

Let us start moving the WordPress live website into a local server:

Step 1:
Backup your WordPress website before doing changes. So, this is a very common thing to backup your website.

Step 2: There are more plugins available in the market for backing up your website.

Step 3: Local server environment installation is the third step. We remind you few setups like

Windows – WAMP

Mac – MAMP

Step 4: Installation of a local server environment is over! Now, start creating a database by using the plugin “phpMyAdmin”.

Let us see how to use plugins for moving WordPress website into a local server:

Step 1:
Search the plugin name “Duplicator” in the search bar. Kindly do the installation and activate it for further use. This plugin will help you to create a duplicate copy of your live website. You may also consider it as a plugin used for backup too!

Step 2: In your WordPress dashboard, add a plugin “Duplicator” in the menu. Check out the available packages too!

Step 3: Tap on the option “create a new package” and then click on the button “New”. You can see the progress of background checks and the summary too will be displayed in front of you.

Step 4: Once if you are done with the background checks tap on the button “build”. The plugin “Duplicator” will create a new package for your website. The website package is displayed in the archive zip file along with the installer file too!!

Step 5: Start downloading the files and install it to your server locally.

How to save your files on a local server?

Step 1:
As a root admin, create a folder in the local server. In present as well as in the future, this folder is the main part of your website storage.

Step 2: You can also create folders inside each new folder. Save the installer file and archive zip file in the local server new folder.

Step 3: For installation, open the file installer.php and then check on the script of duplicator installation.

Step 4: Tap on the button “Next”. By now, the duplicator will ask your database details for which you created previously.

Step 5: The name of the server is localhost and root is the username. No need to enter the password because some installer doesn’t seek for passwords for login.

Step 6: Tap on the button “test database”. This helps you to check the database details whether it is correct or not?

Moving WordPress live website into local server manually:

In the above method, we have used a plugin as the main tool to move the WordPress website into a local server. Just imagine a situation – Plugins shouldn’t be your main choice. It’s just a plugin right! What would happen if the plugin stuck in middle or any technical issue? So, consider doing the manual process as the backup always.

Step 1: Don’t forget to take a backup first. Go to the cPanel dashboard and then tap on the option “phpMyadmin”.

Step 2: Now, you need to start exporting the database. In PHPMyAdmin, search for the option “export”. You can see two methods there such as custom and quick method. You need to select from those two options.

Step 3: We suggest picking a custom export method also take the compression method in the zip file. Plugins usually create tables inside the database so, if you don’t want to choose plugins anyway custom export will ignore those tables.

Step 4: Don’t do any changes to other options!! Leave it as it is just tap on the button “Go” so that, you can download the backup database in zip format.

Step 5: In step 5, start downloading the WordPress files. Use FTP for connecting WordPress and then download the files one by one. The selection of a WordPress file is your choice!!

Step 6: Create a new folder inside the local server it’s because you need to save those files in this new folder. Just proceed with copy & paste in the local server new folder.

Step 7: Again, start importing the database of WordPress. You would have downloaded the WordPress database already so, just copy-paste into a new folder of the local server.

Step 8: The import option will be next to the export option. Go to import and then tap on the option “choose file”. You would have exported the file already right just upload it.

Step 9: Tap on the button “Go”. Unzip the file using PhpMyAdmin and then import it. The database part is completed.

Step 10: Make a reference of URL into a live website inside the database. Use the SQL query for doing URL reference. Ensure, you have chosen a database local site for tapping SQL.

Step 11: Copy the below-mentioned code into SQL:

Code:
UPDATE wp_options SET option_value = replace(option_value, 'https://www.example.com', 'http://localhost/mylocalsite') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, 'https://www.example.com', 'http://localhost/mylocalsite');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'https://www.example.com','hhttp://localhost/mylocalsite');
Note: Place your URL instead of example.com

Step 12: Lastly, update the wp-config.php file. This file helps you to redirect the settings of WordPress to get connected by the database.

Step 13: Go to the local server and then tap on the folder created before. Open the file wp-config.php using Notepad or some text editors.

Step 14: You would have created a database already in the localhost. So, just rename the database name in phpMyAdmin.

Step 15: Again, replace the username of the database most probably it would be root as the username. If you have passwords enter it and then does the login process as normal.

Step 16: Save the changes made till now. Go to the browser and then enter the local site created by you.

It's over! You have completed the WordPress live website changing into a local server. You need to do it carefully since it has full listed steps. I Hope, you would get an idea by now!!!

Thank you!
Author
bhawanisingh
Views
186
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from bhawanisingh

Top