From 851ae70d43fb093fdd8916bd7f56c238feb346fd Mon Sep 17 00:00:00 2001 From: Alex Dusenbery Date: Mon, 26 Feb 2024 15:05:02 -0500 Subject: [PATCH] build: use mysqldump to backup/restore databases --- Makefile | 7 +++++++ docker-compose.yml | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f0ea7516dba..8cb2cd6369c 100644 --- a/Makefile +++ b/Makefile @@ -482,6 +482,13 @@ dev.dbcopy8.%: ## Copy data from old mysql 5.7 container into a new 8 db dev.dbshell.%: ## Run a SQL shell on the given database. docker compose exec mysql80 bash -c "mysql $*" +dev.mysqldumpall: + docker compose exec mysql80 mysqldump --all-databases > .dev/devstackall.sql + +dev.mysqlrestoredump: dev.up.mysql80 + sleep 10 # give it time + docker compose exec -T mysql80 mysql < .dev/devstackall.sql + # List of Makefile targets to run static asset generation, in the form dev.static.$(service) # Services will only have their asset generation added here # if the service is present in both $(DEFAULT_SERVICES) and $(ASSET_SERVICES). diff --git a/docker-compose.yml b/docker-compose.yml index 694dbaf6418..8377155d2f9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -418,7 +418,6 @@ services: - memcached - mongo - mysql80 - - mysql57 # Allows attachment to the LMS service using 'docker attach '. stdin_open: true tty: true