Skip to content

Instantly share code, notes, and snippets.

@morganestes
Created March 10, 2020 19:09
Show Gist options
  • Select an option

  • Save morganestes/661a5d5e70b23c7ef5d219fef0b77977 to your computer and use it in GitHub Desktop.

Select an option

Save morganestes/661a5d5e70b23c7ef5d219fef0b77977 to your computer and use it in GitHub Desktop.
WP Engine DevKit to Local migration
#!/usr/bin/env bash
# https://wpengine.com/support/local/
function _wpe_migrate_to_local() {
local slug="${1:-$(basename $(pwd))}"
echo "Backing up ${slug}..."
mkdir local-${slug}
wpe wp db export local-${slug}.sql && mv local-${slug}.sql local-${slug}/
rsync -avP wp-content/ local-${slug}/wp-content --exclude mu-plugins
zip -r local-${slug}.zip local-${slug}/
}
alias wpe-migrate=_wpe_migrate_to_local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment