Draft: Add gdk org configure-replication command

Summary

Adds the gdk org configure-replication command to set up Geo replication between a source (primary) and target (secondary) cell for organization migration.

This is a slice of the full org migration POC (!5619 (merged)) focusing only on the configure-replication step.

Usage

Configure in gdk.yml:

cells:
  enabled: true
  instance_count: 1
  org_migration:
    source_cell: legacy-cell
    targets:
      cell-2:
        organization_ids:
          - 1000
  instances:
    - config:
        geo:
          enabled: true
          node_name: cell-2

Then run:

gdk org configure-replication

This:

  1. Validates that both source and target cells are configured
  2. Checks that both cells have a Premium or Ultimate license
  3. Enables required feature flags on both cells:
    • Source: geo_selective_sync_by_organizations
    • Target: geo_selective_sync_by_organizations + org_migration_target_cell
  4. Creates Geo primary node on source cell
  5. Creates Geo secondary node on target cell
  6. Sets up the tracking database on the target cell
  7. Copies the db_key_base secret from source to target
  8. Copies the geo_nodes table from source to target
  9. Restarts Sidekiq on the target cell

Feature flags

The org_migration_target_cell feature flag is enabled on the target cell to mark it as an org migration target. This requires gitlab!219850 which adds this feature flag.

Merge request checklist

  • This MR references an issue describing the change.
  • This change is backward compatible.
  • Tests added for new functionality.
  • Documentation added/updated.
Edited by Michael Kozono

Merge request reports

Loading