Search code examples
wordpresslocalhostclone

Cloning wordpress to localhost


I'm trying to clone a wordpress website on to the local host to carryout a small development work and I'm having few issues here. Firstly, this is the procedure that I followed.

  1. Installed XAMPP at C:\xampp on the Windows 10
  2. Edited httpd.conf in Apache Config and changed to port 8080 by making the change Listen 8080
  3. XAMPP runs successfully (both Apache and MySQL). When I visit the http://localhost:8080, I get the welcome screen
  4. I go to http://localhost:8080/phpmyadmin/ , I see the phyMyAdmin screen.
  5. I create a new database with the name, database in phpMyAdmin and subsequently import the database file that I would like to clone. Before importing, I replace all the keywords that contain localhost to localhost:8080 in the database file. The database gets imported successfully.
  6. I copy all the wordpress files from the hosting server and place them in C:\xampp\htdocs\wp
  7. Edit the wp-config.php and change the following:

    database_name_here to database
    username_here to root
    password_here to '' (blank)
    

When I go to http://localhost/wp/ or http://localhost:8080/wp/, I get HTTP Error 404. The requested resource is not found.

Can anyone point what is going on here?


Solution

  • No need to do more effort, just follow below steps after you copy all files, change config file & download SQL file from source.

    1. > Open SQL file & replace "Live URL" with "http://localhost:8080/wp/" ( include HTTP:// & www)
    2. > now import edited SQL on the local machine.
    3. > open admin first from http://localhost:8080/wp/wp-admin
    4. > go to settings > permalink section & click on save button.

    That's it, your site now working on your local machine.

    Your 404 error may cause of "Step 4" to reset permalink. http://www.inmotionhosting.com/support/edu/wordpress/wordpress-features/reset-permalinks