Skip to content

Instantly share code, notes, and snippets.

@keg
Last active November 10, 2016 23:05
Show Gist options
  • Save keg/2716dd5f26d4a103385d to your computer and use it in GitHub Desktop.
Save keg/2716dd5f26d4a103385d to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "*********VIP REPLACE SCRIPT STARTING**********"
##merge the sql files to one for easy import
echo ""
echo "Combining sql files in to one"
echo ""
{ echo "SET SQL_MODE='ALLOW_INVALID_DATES';" ; cat wp_*.sql ; } > combined_vaultpress_dump.sql
#remove the old sql files
echo ""
echo "Removing old sql files"
echo ""
rm wp_*.sql
#replace bad sql syntax
echo ""
echo "Replacing bad SQL, this can take a few minutes... :D"
echo ""
sed -i '' -e 's/SET NAMES ;//g' combined_vaultpress_dump.sql
echo "*****************ALL DONE*********************"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment