From b580c3e0e1783e9685e51485d89f020bfa5158ca Mon Sep 17 00:00:00 2001 From: Muhammad Umar Khan Date: Mon, 9 Oct 2023 17:19:11 +0500 Subject: [PATCH] chore: update dbcopyall8 command --- Makefile | 13 ++++++++++++- docs/manual_upgrades.rst | 17 +++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 629da474a3b..210d4170ca5 100644 --- a/Makefile +++ b/Makefile @@ -462,12 +462,23 @@ dev.shell.%: ## Run a shell on the specified service's container. dev.dbshell: docker compose exec mysql80 bash -c "mysql" +dev.dbsetupmysql8: + docker compose exec -T mysql80 bash -e -c "mysql -uroot mysql" < provision-mysql80.sql + +dev.dbcleanmysql8: + docker container rm edx.devstack.mysql80 + docker volume rm devstack_mysql80_data + DB_NAMES_LIST = credentials discovery ecommerce notes registrar xqueue edxapp edxapp_csmh dashboard analytics-api reports reports_v1 _db_copy8_targets = $(addprefix dev.dbcopy8.,$(DB_NAMES_LIST)) -dev.dbcopyall8: ## Copy data from old mysql 5.7 containers into new mysql8 dbs +dev.dbcopyall8: ## Clean mysql80 container and copy data from old mysql 5.7 containers into new mysql8 dbs + $(MAKE) stop + $(MAKE) dev.dbcleanmysql8 $(MAKE) dev.up.mysql57+mysql80 $(MAKE) dev.wait-for.mysql57+mysql80 + $(MAKE) dev.dbsetupmysql8 $(MAKE) $(_db_copy8_targets) + $(MAKE) stop dev.dbcopy8.%: ## Copy data from old mysql 5.7 container into a new 8 db docker compose exec mysql57 mysqldump "$*" > .dev/$*.sql diff --git a/docs/manual_upgrades.rst b/docs/manual_upgrades.rst index 888b4640b6f..c786b06ae87 100644 --- a/docs/manual_upgrades.rst +++ b/docs/manual_upgrades.rst @@ -12,11 +12,7 @@ Please add new instructions to the top, include a date, and make a post in the ` The MySQL service has been upgraded from version 5.7 to 8.0. Developers will need to follow the following instructions. -1. Stop the running containers :: - - make dev.stop - -2. Take latest ``git pull`` of ``devstack`` and ``edx-platform`` +1. Take latest ``git pull`` of ``devstack`` and ``edx-platform`` 3. Take the latest pull of images :: make dev.pull @@ -25,7 +21,8 @@ The MySQL service has been upgraded from version 5.7 to 8.0. Developers will nee make dev.provision -5. [Optional] Additionally, there is a database copy command to help you transfer data from MySQL 5.7 to 8.0. After provisioning use the following command :: +5. [Optional] Additionally, there is a database copy command to help you transfer data from MySQL 5.7 to 8.0. After provisioning use the ``dev.dbcopyall8`` command. + This command will stop all of your services. Will clean your ``mysql80`` container and copy all of your databases from ``mysql57`` to ``mysql80``. :: make dev.dbcopyall8 @@ -46,6 +43,14 @@ This command copies the following databases: If you prefer not to copy all databases, update ``DB_NAMES_LIST`` in the ``Makefile`` of devstack before running the dbcopy command. +6. Now start your services again :: + + make dev.up + +7. You might need to apply latest migrations to your ``mysql80`` container. To do that, run the following command :: + + make dev.migrate + 2023-08-02 - Forum upgrade from Ruby 2 to 3 *******************************************