Created
December 16, 2016 14:09
-
-
Save dalethedeveloper/98fc081210ed1ba2f364d0079620d734 to your computer and use it in GitHub Desktop.
Extract a single WP Multisite Side DB Files
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/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