WordPress Manual Site Migration to Local

This is my preferred procedure for bringing a remote site to my Local server for development.

Requirements

  1. Local - https://localwp.com/
  2. File system access for both source and destination websites.
  3. phpMyAdmin access on source website.

Backup Procedure

  1. Access the file system of the source website and download a copy of the site's wp-content folder. You can do this via FTP or via the hosting account's file manager application.
  2. Export the source website's database to a .sql file using phpMyAdmin. The quick export default conditions work for this.
    • You should be prompted to download the .sql file.

Restore to new location

  1. Create a fresh WordPress site in Local.
  2. Access the file system and replace the wp-content folder with the one downloaded from the source site.
  3. Reset the destination site's database by removing all the tables.
    • Open the database in Adminer.
    • Select all the tables.
    • Click Drop.
    • Note: the wp cli command 'wp db reset' does not work at the time of this writing in Local.
  4. Restore import the source database to the destination database using wp-cli.
    • Copy the source website's database backup file to the root of you Local WordPress installation.
    • In Local select the destination site, right click, and select "Open Site Shell". A command line window should open.
    • At the command line import the database using the wp-cli command: "wp db import <database backup sql filename>".
    • Upon success you may delete the source website .sql backup file from site's file system.
  5. Use wp-cli search and replace to replace the source site url with the destination site url in the database.
    • At the command line type: "wp search-replace 'https://source-site-url' 'https://destination-site-url".
Scroll to Top