Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WordPress][wp-cli] テーブルごとにエクスポートファイルを作成する
#!/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
You can’t perform that action at this time.