This guide assumes you’re using https://localwp.com for your local environment.
wp db export ~/.mysqldump/wp_transfer.sql
- Connect to server via FTP
- Transfer ~/.mysqldump/wp_transfer.sql to your desktop
- Open Local
- Right click on the local site and select ‘Open site shell’
wp db import ~/Desktop/wp_transfer.sql —dry-run
to verify, thenwp db import ~/Desktop/wp_transfer.sql
- If this command fails, try this workaround: https://localwp.com/community/t/lightning-open-site-shell-not-working/14150/7
mysql -u root -proot local < ~/Desktop/wp_transfer.sql
https://developer.wordpress.org/cli/commands/search-replace/#examples