diff --git a/syncfromlivetostaging.sh b/syncfromlivetostaging.sh new file mode 100644 index 0000000..8ea697e --- /dev/null +++ b/syncfromlivetostaging.sh @@ -0,0 +1,5 @@ +#!/bin/bash +liveURL="`cat /var/www/webroot/sourcefiles/livedomain`" +stagingURL="`wp option get siteurl | sed -e 's/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/'`" + +cd /var/www/webroot/ROOT/ && wp db import /var/www/webroot/sourcefiles/dbexport.sql --path=/var/www/webroot/ROOT/ && cp -R -u /var/www/webroot/sourcefiles/* /var/www/webroot/ROOT && wp cache flush && wp search-replace $liveURL $stagingURL --all-tables --precise \ No newline at end of file