Update syncfromlivetostaging.sh

Added step to save the staging domain
main
jay 2023-09-07 07:23:32 +00:00
parent 030d5c12e9
commit 63765be2e7
1 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
#!/bin/bash
liveURL="`cat /var/www/webroot/sourcefiles/livedomain`"
stagingURL="`wp option get siteurl | sed -e 's/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/'`"
#stagingURL="`wp option get siteurl | sed -e 's/[^/]*\/\/\([^@]*@\)\?\([^:/]*\).*/\2/'`"
stagingURL="`cat /var/www/webroot/ROOT/stagingdomain`"
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