Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SERVER-2273] Migrate 3.4 to a new 4.0 instance #37

Merged
merged 19 commits into from
Mar 13, 2023

Conversation

lloydChris
Copy link
Contributor

⚙️ Issue

Sometimes KOTS does not have the expected helm application installed. In this case we need to do the migration to 4.0 a different way.

Fix

Migrate from 3.4 to 4.0 with database migrations between 2 separate installations.

Very little of this is net new work. It is mostly copy pasted from the 2.19 migration scripts.
I prioritized minimizing changes over beautiful and concise code. Also, this is currently to solve a problem for one customer and is unlikely to see use beyond that.

To make your review easier, consider reviewing each commit individually, or comparing the files to what they were copied from:

migrate-3-to-4/exporter.sh - kots-exporter/kots-exporter.sh
migrate-3-to-4/bottoken.sh - migrate/3.0-bottoken.sh
migrate-3-to-4/key.sh - migrate/3.0-key.sh
migrate-3-to-4/mongo.sh - migrate/3.0-mongo.sh
migrate-3-to-4/postgres.sh - migrate/3.0-postgres.sh
migrate-3-to-4/prefligh.sh - migrate/3.0-preflight.sh
migrate-3-to-4/scale.sh - migrate/3.0-scale.sh
migrate-3-to-4/vault.sh - migrate/3.0-vault.sh
migrate-3-to-4/restore.sh - migrate/3.0-restore.sh

Tests

  • tested the migration between new 3.4 and 4.0 instances

@lloydChris lloydChris requested review from a team February 23, 2023 15:16
@lloydChris lloydChris force-pushed the SERVER-2273-3-to-4-no-kots branch 6 times, most recently from 5c24257 to 5f2ff50 Compare February 23, 2023 19:06
@lloydChris lloydChris changed the title [SERVER-273] Server 2273 3 to 4 no kots [SERVER-2273] Migrate 3.4 to a new 4.0 instance Feb 23, 2023
@lloydChris lloydChris force-pushed the SERVER-2273-3-to-4-no-kots branch from 86b74b5 to 496ada3 Compare March 1, 2023 16:56
migrate-3-to-4/README.md Outdated Show resolved Hide resolved
Co-authored-by: Ryan William O'Hara <[email protected]>
TEMP_DIR="/bitnami/circle-mongo"
kubectl -n "$namespace" exec -it "$MONGO_POD" -- bash -c "mkdir $TEMP_DIR"
kubectl -n "$namespace" exec -it "$MONGO_POD" -- bash -c "mongodump -u '$MONGODB_USERNAME' -p '$MONGODB_PASSWORD' --authenticationDatabase admin --db=circle_ghe --out=$TEMP_DIR"
kubectl -n "$namespace" cp $MONGO_POD:$TEMP_DIR ${BACKUP_DIR}/circle-mongo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we include a step here to remove the /bitnami/circle-mongo/ backup directory
just in case the script needs to be rerun and the local mongobackup was deleted. not a blocker, just a thought

@lloydChris lloydChris merged commit 84a3792 into main Mar 13, 2023
@lloydChris lloydChris deleted the SERVER-2273-3-to-4-no-kots branch March 13, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants