Created
November 14, 2014 00:33
-
-
Save teledirigido/64b280392e52b26f9322 to your computer and use it in GitHub Desktop.
MySQL backup on post-merge
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 | |
# Post-merge hook to add a mysql db when post-merge occurs. | |
# | |
## Change the following values to suit your local setup. | |
# The name of a database user with read access to the database. | |
DBUSER=[dbuser] | |
# The password associated with the above user. Leave commented if none. | |
DBPASS=[dbpass] | |
# The database associated with this repository. | |
DBNAME=[dbname] | |
# The path relative to the repository root in which to store the sql dump. | |
DBPATH=[dbpath] | |
# Replace foreign url for new url | |
PROJECT=[project-name-url] | |
OLDURL=http://labs.blacksheepdesign.co.nz/$PROJECT/site | |
NEWURL=http://miguel.dev/$PROJECT/site | |
mysql -u $DBUSER -p$DBPASS $DBNAME < $DBPATH/$DBNAME.sql | |
wp search-replace $OLDURL $NEWURL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment