This video tutorial shows you how to copy WordPress website from live server to a local one.
First of all, you need to make a backup of the current live website. You can check the tutorial on how to make a WordPress website backup here.
Copy the files of the live website to localhost.
After saving the backup files on your computer, start the localhost software (in this case, we use WAMP). Open WAMP to start this program.
Then open the wamp/www folder on the local drive. We will copy the website .zip files which were downloaded from the live server to www folder and unzip it.
You can see all the files here.
You can give a specific name for this local WordPress directory. We named it as wordpress under www folder.
Rename the wp-config.php file. You can also remove this file completely.
Create the database within your localhost.
Open a browser. Type localhost/phpmyadmin in the address bar.
Click on Databases tab.
Create a new database.
Click on this new database to open it.
We will need to import the .sql file which we have got from the backup file to this new database.
But first, we should edit this .sql file to change the url to the localhost url.
Open the .sql file with a code editor. Use the replace function of the code editor software to replace it with the local url.
The local url will look as http://localhost/wordpress-folder
It’s: http://localhost/wordpress in our case.
Replace all the url instances and save the file.
Go back to phpmyadmin in localhost. Click on the Import.
Browse the edited .sql file. Hit the Go button to import it.
We get the successful import message here.
On the last step, we will connect the website’s files with the database.
Open a new tab on the browser, and type the local site url in the address bar.
The installation page is opened. We will follow the steps on the screen to run the installation.
Creating wp-config.php file, which was renamed/removed previously.
Adding the localhost database details. The table prefix should be the one, used for the live url and it is wp_
Just keep following the steps that appear on the installation screen. Log in with the same details that were used for the live website.
The site is copied to the localhost now!
Feel free to check the detailed video tutorial below.WordPress. How to copy WordPress website from live server to a local one