Files
wp-docker-setup/migrate-db-paths.sh
2023-11-24 08:29:00 +01:00

28 lines
637 B
Bash
Executable File

#! /bin/sh
#
set -a
. "${PWD}/.env"
. "${PWD}/env_files/migrate-db.env"
set +a
echo wp migratedb find-replace --find="//${REMOTE_WP_URL}","${REMOTE_WP_PATH}" --replace="//${APP_URL}",/var/www/html
read -p "Do we run the thing ? " REPLY
if [ "$REPLY" != "${REPLY#[YyOo]}" ]; then
echo "we carry on"
else
echo "we stop"
exit 1
fi
date +%H-%M-%S
docker exec --user www-data "${PREFIX}-app" /bin/sh -c '
wp plugin install wp-migrate-db ; \
wp plugin activate wp-migrate-db ; \
wp migratedb find-replace \
--find='"//${REMOTE_WP_URL}"','"${REMOTE_WP_PATH}"' \
--replace='"//${APP_URL}"',/var/www/html
'
date +%H-%M-%S