You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

migrate-db-paths.sh 637B

123456789101112131415161718192021222324252627
  1. #! /bin/sh
  2. #
  3. set -a
  4. . "${PWD}/.env"
  5. . "${PWD}/env_files/migrate-db.env"
  6. set +a
  7. echo wp migratedb find-replace --find="//${REMOTE_WP_URL}","${REMOTE_WP_PATH}" --replace="//${APP_URL}",/var/www/html
  8. read -p "Do we run the thing ? " REPLY
  9. if [ "$REPLY" != "${REPLY#[YyOo]}" ]; then
  10. echo "we carry on"
  11. else
  12. echo "we stop"
  13. exit 1
  14. fi
  15. date +%H-%M-%S
  16. docker exec --user www-data "${PREFIX}-app" /bin/sh -c '
  17. wp plugin install wp-migrate-db ; \
  18. wp plugin activate wp-migrate-db ; \
  19. wp migratedb find-replace \
  20. --find='"//${REMOTE_WP_URL}"','"${REMOTE_WP_PATH}"' \
  21. --replace='"//${APP_URL}"',/var/www/html
  22. '
  23. date +%H-%M-%S