Add syncfromlivetostaging.sh

This will have to run on the staging environment. It will copy the files form the NFS mount and update the database
main
jay 2023-09-05 21:13:35 +00:00
parent 2d9a86222c
commit 640437e9fd
1 changed files with 5 additions and 0 deletions

View File

@ -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