Skip to content

Instantly share code, notes, and snippets.

@drawcard
Created February 25, 2020 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drawcard/d1615128f943af6d5828c161775e24e0 to your computer and use it in GitHub Desktop.
Save drawcard/d1615128f943af6d5828c161775e24e0 to your computer and use it in GitHub Desktop.
Manually migrate production WP DB to local environment, using WP CLI

This guide assumes you’re using https://localwp.com for your local environment.

Pull DB from the production server

  • wp db export ~/.mysqldump/wp_transfer.sql

Transfer DB from the production server to local

  • Connect to server via FTP
  • Transfer ~/.mysqldump/wp_transfer.sql to your desktop

Replace the DB in the local site

Replace URLs in the local DB

https://developer.wordpress.org/cli/commands/search-replace/#examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment