Page MenuHomePhabricator

Migration to MariaDB operator: Patchdemo DB
Closed, ResolvedPublic5 Estimated Story Points

Description

This task tracks the migration for the patchdemo DB.

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
migrate DB to MariaDB operator: Step 5repos/test-platform/catalyst/patchdemo!232jnucheT408118-5main
migrate DB to MariaDB operator: Step 4repos/test-platform/catalyst/patchdemo!231jnucheT408118-4main
migrate DB to MariaDB operator: Step 3repos/test-platform/catalyst/patchdemo!230jnucheT408118-3main
migrate DB to MariaDB operator: Step 2repos/test-platform/catalyst/patchdemo!229jnucheT408118-2main
migrate DB to MariaDB operator: Step 1repos/test-platform/catalyst/patchdemo!228jnucheT408118-1main
Customize query in GitLab

Event Timeline

thcipriani moved this task from Backlog to Linja on the Catalyst board.
thcipriani edited projects, added Catalyst (Linja); removed Catalyst.
thcipriani set the point value for this task to 5.

We will announce a maintenance window for the migration.

Migration plan
  1. Scale down Production Patchdemo while we work on Staging: kubectl -n patchdemo scale deployment patchdemo --replicas=0
  2. Back up K3s data disc for the control plane host k3s
  3. Create at least a couple of wikis on Staging
  4. Merge https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/228 (Deploy operator DB for Staging)
  5. Perform Manual migration + checks steps for NS=patchdemo-staging
  6. Merge https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/229 (Remove bitnami DB for Staging)
  7. Check Staging health. The Staging bitnami PVC should have survived at this point
  8. Merge https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/230 (Deploy operator DB for Production)
  9. At this point Production Patchdemo will be scaled up again
  10. Perform Manual migration + checks steps for NS=patchdemo
  11. Merge https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/231 (Remove bitnami DB for Production)
  12. Check Production health. The Production bitnami PVC should have survived at this point
  13. Merge https://gitlab.wikimedia.org/repos/test-platform/catalyst/patchdemo/-/merge_requests/232
  14. Success!
Manual migration + checks

For a given Namespace, once the operator DB has been deployed and while the bitnami DB is still up and running, we do the following:

PASS=<rootPass>
NS=<nameSpace>

  1. Dump patchdemo from bitnami:
    • kubectl -n $NS exec $NS-mariadb-0 -- mariadb-dump -u root -p"$PASS" --single-transaction patchdemo (plus all other patchdemo_ DBs) > ~/backupDB-$NS.sql
  2. Import into operator
    • kubectl -n $NS exec -i $NS-mariadbop-0 -- mariadb -u root -p"$PASS" patchdemo < ~/backupDB-$NS.sql
  3. Manually point Patchdemo deployment to operator DB and perform checks:
    • kubectl -n $NS edit deployment.apps/patchdemo -> Edit DB_HOST=patchdemo-mariadbop
    • Perform checks
    • Undo changes and point back to bitnami DB
jnuche moved this task from In progress to Done on the Catalyst (Luka Moli Telo) board.

Production DB migrated