From 640437e9fd8dbfa42f4b59697c8cdba6878d3167 Mon Sep 17 00:00:00 2001 From: jay Date: Tue, 5 Sep 2023 21:13:35 +0000 Subject: [PATCH] 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 --- syncfromlivetostaging.sh | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 syncfromlivetostaging.sh 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