Compare commits

...

4 Commits

Author SHA1 Message Date
Jean-Christophe Vanhalle
75298677b0 prints out wp migrate command and asks for go 2023-11-24 08:29:00 +01:00
Jean-Christophe Vanhalle
d71b16e10f fixes wrong ownership for bindfs 2023-11-24 08:28:11 +01:00
Jean-Christophe Vanhalle
623bd1741d prevents migration from failing when migrate-db is already activated 2023-11-24 02:03:31 +01:00
Jean-Christophe Vanhalle
7c72290ccf excludes wp-config.php from remote to local syncing 2023-11-24 02:01:03 +01:00
3 changed files with 17 additions and 6 deletions

View File

@@ -6,12 +6,22 @@ set -a
. "${PWD}/env_files/migrate-db.env" . "${PWD}/env_files/migrate-db.env"
set +a set +a
+date +%H-%M-%S 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 ' docker exec --user www-data "${PREFIX}-app" /bin/sh -c '
wp plugin install wp-migrate-db && \ wp plugin install wp-migrate-db ; \
wp plugin activate wp-migrate-db && \ wp plugin activate wp-migrate-db ; \
wp migratedb find-replace \ wp migratedb find-replace \
--find='"//${REMOTE_WP_URL}"','"${REMOTE_WP_PATH}"' \ --find='"//${REMOTE_WP_URL}"','"${REMOTE_WP_PATH}"' \
--replace='"//${APP_URL}"',/var/www/html --replace='"//${APP_URL}"',/var/www/html
' '
+date +%H-%M-%S date +%H-%M-%S

View File

@@ -31,8 +31,8 @@ for volume in ${volumes}; do
fi fi
echo "mounting ${mount_path}" echo "mounting ${mount_path}"
sudo /usr/bin/bindfs \ sudo /usr/bin/bindfs \
--create-for-group=root \ --create-for-group=www-data \
--create-for-user=root \ --create-for-user=www-data \
--force-group="${MOUNT_USER}" \ --force-group="${MOUNT_USER}" \
--force-user="${MOUNT_USER}" \ --force-user="${MOUNT_USER}" \
"${volume_path}" \ "${volume_path}" \

View File

@@ -29,6 +29,7 @@ fi
rsync \ rsync \
--archive \ --archive \
--delete \ --delete \
--exclude '/wp-config.php' \
--exclude-from='exclude-list' \ --exclude-from='exclude-list' \
--human-readable \ --human-readable \
--progress \ --progress \