How to Move WordPress Website from Live Server to Local Host

We have already seen How to Move WordPress from one server to a new host. In this post, let’s know How to Move a WordPress Website from a Live Server to a Local Host.

How to Move WordPress Website from Live Server to Local Host

How to Move WordPress Website from Live Server to Local Host

  1. Backup should be taken from the live server.
    i. Compressing and downloading the file from File Manager
    ii. Exporting database from phpMyAdmin on live server
  2. Install XAMPP on your PC
  3. Extracting your website files (localhost)
  4. Create and import a database (localhost)
  5. Editing wp-config file (localhost)
  6. Replacing live server URL to localhost URL

1. Backup should be taken from the live server.

Compressing and downloading the file from File Manager

Compressing and downloading the file from File Manager

i. Compressing and downloading the file from File Manager (Live Server) – Go to the file manager in the live server and select the domain you want to move. Select all the files in that folder. Click the compress button at the top left. A compressed folder will be created in zip format. Download that folder.
CPanel > File Manager > Select All > Compress.

Exporting database from phpMyAdmin on live server

Exporting database from phpMyAdmin on live server

ii. Exporting database from phpMyAdmin on live server – Login to live server. After login cPanel will have a lot of tools available. phpMyAdmin is available Under the heading ‘Database ‘. Click on it and a new window will open. There the databases of all the domains on our server are located.

Select which domain we want to back up. Now click on Export at the top right and click Go. Now your database is downloaded.
cPanel > phpMyAdmin > Export > Go.

Check out when you free – World’s first automatic and online HTML to WordPress converter

2. Install XAMPP on your PC

You need to download XAMPP, AMPPS or any other application to run WordPress on your PC or Laptop. In this post, I have explained using XAMPP. XAMPP Download Link

As usual, download and install. Avoid this for those who have already installed it.

3. Extracting your website files (localhost)

Extracting your website files

Extracting your website files

After installing XAMPP, go to the XAMPP folder in your Local drive (C:). Inside XAMPP is the htdocs folder. There we have to bring here the zip format backup file taken from the live server.

XAMPP Control Panel

XAMPP Control Panel

Do not forget Start XAMPP Control Panel. See the picture. Inside the XAMPP Control Panel Start Apache and MySQL. All the processes you are doing in localhost only start running.

Then extract the folder. After extracting, all the files inside the folder will be displayed. As shown in the photo. Local URL should be for you  This PC > Local Disk (C:) > xampp > htdocs > your folder name

4. Create and import a database

Go directly to phpMyAdmin and create a database. The URL is localhost/phpmyadmin/

Create new database on localhost

Create a new database on localhost

Once inside the phpMyAdmin window, there will be many database files on the left side. Click on New above it
localhost > phpMyAdmin > New > Database name

Create and import database

Create and import database

Then, to create the database, enter the name in the database name field. Now the database you created will display. Click on that database and import (backup database taken from live server)
localhost > phpMyAdmin  > created database > import > select file > go.

Now you got a message database successfully submitted.

5. Editing wp-config file (localhost)

Editing wp-config file

Editing wp-config file

Now you need to edit the wp-config file on the local server. There are three main things.
This PC > Local Disk (C:) > xampp > htdocs > your file > wp-config.php

  1. Enter your database name (Already you created see No.4 topic)
  2. Username should always be root.
  3. Password should be left blank.

After editing the wp-config.php file just save it.

6. Replacing live URL to localhost URL

Replacing live server URL to localhost URL

Replacing live URL to localhost URL

Finally, click on the database you created inside phpMyAdmin. Then click on the wp-options below.

On the right side there will be siteurl and home, their option_value will contain the detail of the live URL.

On the left is Edit, click on it and replace the old URL with localhost. Do this for both home and siteurl.

replace url

replace URL

Ex. localhost/your-folder-name (folder inside htdocs)
phpMyAdmin > your database > wp options > siteurl > edit >replace name to localhost/folder-name > Go
phpMyAdmin > your database > wp options > home> edit >replace name to localhost/folder-name > Go

Note: sometimes, http://localhost/your-folder-name works well! if not enter localhost/your-folder-name

permalink post name

permalink post name

At last, Login your wp-admin page go to setting > permalink > common setting > select post name(it is based on your wordpress URL format) > save changes.

Thank you for reading this article! This is the way we move the WordPress site from live host to localhost.

Read More

Top Stories

Parenting Tips

Child Stories

Education

Blogging

Technology

Astrology

Ketu in 12th House

Ketu's positioning in the 12th house of the birth chart in Vedic astrology shapes an individual's spirituality,...

Unsolved Mysteries