Created
March 10, 2020 19:09
-
-
Save morganestes/661a5d5e70b23c7ef5d219fef0b77977 to your computer and use it in GitHub Desktop.
WP Engine DevKit to Local migration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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