Skip to content

Instantly share code, notes, and snippets.

@rorymcdaniel
Created April 26, 2017 20:08
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 rorymcdaniel/5c05f042b3370d49cf1d78502367d85e to your computer and use it in GitHub Desktop.
Save rorymcdaniel/5c05f042b3370d49cf1d78502367d85e to your computer and use it in GitHub Desktop.
Sync a remote WordPress database with local
# this assumes you have a WP CLI alias set up for your production environment already
# https://roots.io/leveraging-wp-cli-aliases-in-your-wordpress-development-workflow/
# Just add this to your ~/.bashrc for unix or ~/.bash_profile for Mac
alias syncwpdb='wp @production db dump - > production.sql && wp db reset --yes && wp db import production.sql && rm production.sql'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment