Create a tool to migrate existing self-managed customers to decomposed
Problem to solve
Currently, all self-managed customers only utilize a single database. In order to ensure that the schema between GitLab.com and self-managed is the same, we need to migrate self-managed customers to run decomposed by default. This will take downtime.
We want to deprecate running a single DB by 16.0 and by 17.0 require running decomposed. This means we need to make the tooling available to self-managed customers that executes this downtime. Migrations would be optional in 16.0 but required to be performed before upgrading to 17.0
Proposal
The migration's manual steps is already documented in https://docs.gitlab.com/ee/administration/postgresql/multiple_databases.html#migrate-existing-installations
- Translate above manual steps into a simple bash script. Support Omnibus only
- Ensure to disable Background migrations (feature flag) en ensure no background migrations are running
- Nice to have: pre-flight checks (#368729 (comment 1352513515))
- Nice to have: ability to only run certain steps (#368729 (comment 1367852341))
- Nice to have: Charts support, source install support
Note: Downtime is only required if migrating to two databases. If migrating to two connections to same database, no downtime likely required.