Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Extract a single WP Multisite Side DB Files
#!/bin/bash
WPUSER="username"
WPDBNAME="wp_db"
if [ $# -ne 1 ]
then
echo "Enter a WPMU ID for the Database"
exit
fi
DBS=$(mysql -u $WPUSER -p -ss $WPDBNAME -e "SHOW TABLES LIKE 'wp_$1_%'" | tr "\n" " ")
$(mysqldump -u $WPUSER -p $WPDBNAME $DBS > wp_$1_sql)
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.