Created
December 16, 2015 14:59
-
-
Save wokamoto/44f636978657169594ed to your computer and use it in GitHub Desktop.
[WordPress][wp-cli] テーブルごとにエクスポートファイルを作成する
This file contains 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
#!/bin/sh | |
tables=$(wp db query "show tables;" | grep -v "Tables_in") | |
for table in ${tables}; do | |
echo "--- ${table}" | |
# エクスポート処理 | |
wp db export ${table}.sql --tables=${table} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment