Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
feat: changed backup image to arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
ilee2u committed Mar 7, 2024
1 parent b23ed05 commit 969f001
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -236,17 +236,17 @@ dev.mysqlrestoredump: dev.up.mysql80

## Write all data volumes to the host, except for mysql, just use mysqldump
dev.backup: dev.up.mongo+elasticsearch710+opensearch12+coursegraph dev.mysqldumpall
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.mongo) -v $$(pwd)/.dev/backups:/backup debian:jessie tar zcvf /backup/mongo.tar.gz /data/db
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.elasticsearch710) -v $$(pwd)/.dev/backups:/backup debian:jessie tar zcvf /backup/elasticsearch710.tar.gz /usr/share/elasticsearch/data
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.opensearch12) -v $$(pwd)/.dev/backups:/backup debian:jessie tar zcvf /backup/opensearch12.tar.gz /usr/share/opensearch/data
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.coursegraph) -v $$(pwd)/.dev/backups:/backup debian:jessie tar zcvf /backup/coursegraph.tar.gz /data
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.mongo) -v $$(pwd)/.dev/backups:/backup arm64v8/debian:latest tar zcvf /backup/mongo.tar.gz /data/db
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.elasticsearch710) -v $$(pwd)/.dev/backups:/backup arm64v8/debian:latest tar zcvf /backup/elasticsearch710.tar.gz /usr/share/elasticsearch/data
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.opensearch12) -v $$(pwd)/.dev/backups:/backup arm64v8/debian:latest tar zcvf /backup/opensearch12.tar.gz /usr/share/opensearch/data
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.coursegraph) -v $$(pwd)/.dev/backups:/backup arm64v8/debian:latest tar zcvf /backup/coursegraph.tar.gz /data

## Restore all data volumes from the host. WILL OVERWRITE ALL EXISTING DATA!
dev.restore: dev.up.mongo+elasticsearch710+opensearch12+coursegraph dev.mysqlrestoredump
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.mongo) -v $$(pwd)/.dev/backups:/backup debian:jessie tar zxvf /backup/mongo.tar.gz
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.elasticsearch710) -v $$(pwd)/.dev/backups:/backup debian:jessie tar zxvf /backup/elasticsearch710.tar.gz
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.opensearch12) -v $$(pwd)/.dev/backups:/backup debian:jessie tar zxvf /backup/opensearch12.tar.gz
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.coursegraph) -v $$(pwd)/.dev/backups:/backup debian:jessie tar zxvf /backup/coursegraph.tar.gz
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.mongo) -v $$(pwd)/.dev/backups:/backup arm64v8/debian:latest tar zxvf /backup/mongo.tar.gz
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.elasticsearch710) -v $$(pwd)/.dev/backups:/backup arm64v8/debian:latest tar zxvf /backup/elasticsearch710.tar.gz
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.opensearch12) -v $$(pwd)/.dev/backups:/backup arm64v8/debian:latest tar zxvf /backup/opensearch12.tar.gz
docker run --rm --volumes-from $$(make --silent --no-print-directory dev.print-container.coursegraph) -v $$(pwd)/.dev/backups:/backup arm64v8/debian:latest tar zxvf /backup/coursegraph.tar.gz

# List of Makefile targets to run database migrations, in the form dev.migrate.$(service)
# Services will only have their migrations added here
Expand Down
32 changes: 32 additions & 0 deletions instructions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# YOU MUST USE THIS DEVSTACK BRANCH: https://github.com/openedx/devstack/pull/1282
# Create a "just in case" directory to keep all your backup files
# outside of the devstack directory
mkdir ~/devstack-backups-march-6-2024/

cd $DEVSTACK_WORKSPACE/devstack
git pull
git checkout aed/mysqldump

## This will now create both a mysqldump output SQL file, and
## some tar'd data directories for the other database types.
make dev.backup
cp .dev/devstackall.sql ~/devstack-backups-march-6-2024/
cp .dev/backups/*.tar.gz ~/devstack-backups-march-6-2024/

## NOW BACKUP ALL THE ENTERPRISE IDAS
### enterprise-catalog
cd $DEVSTACK_WORKSPACE/enterprise-catalog
make dev.backup
cp .dev/enterprise_catalog_all.sql ~/devstack-backups-march-6-2024/
### license-manager
cd $DEVSTACK_WORKSPACE/license-manager
make dev.backup
cp .dev/license_manager_all.sql ~/devstack-backups-march-6-2024/
### enterprise-access
cd $DEVSTACK_WORKSPACE/enterprise-access
make dev.backup
cp .dev/enterprise_access_all.sql ~/devstack-backups-march-6-2024/
### enterprise-subsidy
cd $DEVSTACK_WORKSPACE/enterprise-subsidy
make dev.backup
cp .dev/enterprise_subsidy_all.sql ~/devstack-backups-march-6-2024/

0 comments on commit 969f001

Please sign in to comment.