Update v-migrate-site-to-https to use $phpver

This commit is contained in:
myvesta 2024-05-30 13:48:11 +02:00 committed by GitHub
commit 7a13c03e9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -94,6 +94,8 @@ if [ "$DB_EXISTS" = "no" ]; then
exit 6
fi
phpver=$(/usr/local/vesta/bin/v-get-php-version-of-domain "$FROM_DOMAIN")
# ----------- CHECK -------------
FROM_REPLACE1="http://$FROM_DOMAIN"
@ -170,9 +172,9 @@ if [ $IT_IS_WP -eq 0 ]; then
else
cd $SITE_FOLDER
echo "=== Replacing $FROM_REPLACE1 to $TO_REPLACE1 in database $FROM_DATABASE_NAME"
sudo -H -u$FROM_USER wp search-replace "$FROM_REPLACE1" "$TO_REPLACE1" --precise --all-tables --skip-columns=guid
sudo -H -u$FROM_USER /usr/bin/php$phpver /usr/local/bin/wp search-replace "$FROM_REPLACE1" "$TO_REPLACE1" --precise --all-tables --skip-columns=guid --skip-plugins=$(sudo -H -u$TO_USER wp plugin list --field=name | tr '\n' ',') --skip-themes;
echo "=== Replacing $FROM_REPLACE2 to $TO_REPLACE2 in database $FROM_DATABASE_NAME"
sudo -H -u$FROM_USER wp search-replace "$FROM_REPLACE2" "$TO_REPLACE2" --precise --all-tables --skip-columns=guid
sudo -H -u$FROM_USER /usr/bin/php$phpver /usr/local/bin/wp search-replace "$FROM_REPLACE2" "$TO_REPLACE2" --precise --all-tables --skip-columns=guid --skip-plugins=$(sudo -H -u$TO_USER wp plugin list --field=name | tr '\n' ',') --skip-themes;
fi
echo "===== DONE ===="