Skip to content

Instantly share code, notes, and snippets.

@larscmagnusson
Last active August 12, 2019 19:37
Show Gist options
  • Save larscmagnusson/da9f998e5f03d07ff8ef3806698ffd40 to your computer and use it in GitHub Desktop.
Save larscmagnusson/da9f998e5f03d07ff8ef3806698ffd40 to your computer and use it in GitHub Desktop.
wp cli -- db export/import encrypted
#!/usr/bin/env bash
#export
wp db export - | openssl smime --encrypt --text --binary --aes256 --outform DER --out database.sql.enc PATH_TO_PUBLIC_KEY
#import
openssl smime --decrypt --in database.sql.enc --binary --inform DER --inkey PATH_TO_PRIVATE_KEY | wp db import -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment