docs: document backup, Geo, rollback, and version skipping for self-managed

What this does

Adds three rows of the self-managed operations work to docs/dev/self-managed-install.md:

  • ## Backup and restore: the GitLab backup (backup-utility) does not cover AR or iam-data-access. A table lists what the operator backs up: both databases, the AR bucket, ar-encryption-root-key, the other stage 3 Secrets (including secrets.toml), the trusted-ca and iam-data-access-config ConfigMaps, and the values files. The backup runs with AR and iam-data-access stopped, because AR has no read-only mode: dump both databases, save the IAM config, copy the bucket, then start both again. The restored root-key Secret must hold every key that wrapped a row in the restored database. The GitLab backup does cover the Cloud Connector key and the feature flags, but the GitLab secrets that encrypt the key need their own backup. Roll back restores this backup, including copying the bucket back without deleting newer objects.
  • ## Geo: AR and iam-data-access are not in the Geo replicated data types, so a secondary has no copy of their data.
  • ## Upgrading: back up both databases and iam-data-access-config before upgrading. Skipping versions is allowed when the GitLab upgrade path allows the GitLab step. Re-run stage 8 (push and pull) after an upgrade.
  • ### Roll back: a downgrade is not supported in the beta, matching GitLab's restore-only downgrade. The ordered way back is: scale both to 0, restore both databases, restore the ConfigMap if it changed, helm rollback each release, scale up, and run the checks. Data written after the backup is lost.

docs/dev/self-managed-limitations.md:

Evidence

At GitLab v19.5.0-ee, CNG v19.5.0, GitLab chart v10.5.0, AR v2.149.0 (chart 2.149.0), and IAM v1.80.2 (chart 1.80.2):

Claim Where
backup-utility backs up the GitLab DB, repositories, and a fixed list of GitLab buckets. registry is the container registry CNG gitlab-toolbox/scripts/bin/backup-utility:19 (object_storage_backends), :413 (gitlab:backup:db:create), :416 (gitlab:backup:repo:create); Data included in a backup
Rails secrets are not in the chart backup Chart doc/backup-restore/backup.md:184-186, Back up the secrets
The Cloud Connector key lives in the GitLab DB, encrypted ee/app/models/cloud_connector/keys.rb:5 (cloud_connector_keys), :7 (encrypts :secret_key)
That encryption uses keys from the rails secrets config/initializers/3_active_record_encryption.rb:9-12; Storing configuration files
Feature flags live in the GitLab DB lib/feature.rb:30, :34 (FlipperFeature, FlipperGate), :473 (Flipper::Adapters::ActiveRecord)
Namespace keys in the AR DB carry the root key URI that wrapped them internal/datastore/migrations/sql/20260724120000_create_namespace_encryption_keys.sql:33-34
AR tries every key in the root-key Secret; a row wrapped by a key not in it fails internal/crypto/local_provider.go:81-96 (UnwrapKey)
A database restore does not recover a lost root key; removing a key strands older backups docs/runbooks/key-rotation.md:190-192, :210-213
Encrypted columns are remote repository credentials internal/datastore/{container,maven}_remote_credential*.go, npm_remote_repositories.go use RowEncryptor
The AR DB tracks blobs whose content is in the bucket docs/adr/008_content_addressable_storage.md:208, :228, :231
AR DB and bucket backups are the platform's job docs/adr/010_data_retention.md:168-175
AR is not Geo-replicated No Geo replicator for AR in ee/app/replicators/geo/ at v19.5.0-ee; not in replicated data types; no Geo support code in AR at v2.149.0
Data not on the Geo list is lost at failover doc/administration/geo/replication/datatypes.md:167-171
AR migrates at boot with goose and applies every pending migration in order internal/datastore/migrations/migrations.go:53-58 (WithAllowOutofOrder(false)), :67-80 (Up)
goose ignores DB versions the binary does not know, so an older binary starts on a newer schema with no error goose v3.29.0 (both services) internal/gooseutil/resolve.go:29-53 (UpVersions iterates only the binary's own files)
Neither service has its own schema-version check AR: only migrations.Up reads the schema version; IAM: pkg/migrate/migrate.go:77-78 calls provider.Up only
IAM migrates forward only IAM README.md:109-110 ("No -- +goose Down sections. Schemas are never rolled back"); 0 of 31 files in db/migrations/postgres have a Down; scripts/entrypoint.sh:42 runs /app/bin/migrate before the service
Neither chart sets spec.replicas; both render an HPA (minReplicas 2 for AR, 3 for IAM) AR chart 2.149.0 and IAM chart 1.80.2 templates/deployment.yaml (no replicas), templates/horizontal_pod_autoscaler.yaml:1,10, values.yaml scalability.minInstances
An HPA leaves a target scaled to 0 alone until it is scaled up by hand Implicit maintenance-mode deactivation
iam-data-access-config is outside the chart, so helm rollback does not revert it Created with kubectl in stage 4
GitLab downgrade means restoring a backup Downgrade
GitLab's upgrade path governs the GitLab step Upgrade paths
The AR 3.0.0 encryption requirement is already met by the pinned values Stage 5 ar-values.yaml sets encryption: local: {}, so the guide does not repeat it under skipping

Verification

  • Vale: 0 errors, no new warnings against origin/main. markdownlint: 0 issues.
  • Live rollback test on GKE, 2026-10-22, in scratch namespaces. The shared stack's AR and IAM are rendered by Argo CD and are not helm releases, so helm rollback cannot act on them. The shared stack was only read, and it matched its baseline afterwards.
Check Result
Skip upgrade: AR 2.82.1 to 2.149.0 (+4 migrations), IAM 1.55.3 to 1.80.2 (+9) Pass. Every pending migration applied at boot
Rollback, as ### Roll back says Pass. Schema versions, images, and build_info and Health versions are back at the From set. Data from before the backup pulls. The artifact and role written after the backup are gone. No pod ran between scale-down and scale-up
HPA at 0 and after helm rollback Stays at 0 (ScalingDisabled). Scaling to 1 hands control back, up to minReplicas
pg_restore --clean over the upgraded databases Fails: cannot drop constraint on iam-service, out of shared memory on artifact_registry with --single-transaction. Drop and re-create, then pg_restore, works. The guide now says so
ConfigMap restore A -o yaml backup fails with Conflict. Restoring from the saved config.toml works. IAM 1.55.3 needs its older config ([platform.cors])
Bucket Restore by copying the backup back with no delete flag. Checked on GCS with scratch buckets: an object removed after the backup comes back, and one added after it stays. aws s3 sync was not run
Ingress with the stage 5 patch Helm 4.3.0: helm upgrade and helm rollback fail on the kubectl-patch conflict. Delete the Ingress, run the command again, then patch. Helm 3.20.0: both succeed but drop the host. The guide now covers both

GitLab stage 8 was replaced by AR API checks. No GitLab ran: a self-hosted JWKS stood in, activation and role grants went to the AR and IAM APIs directly, and push and pull ran with crane, with every blob verified by digest.

Round 3 review changes (5e35d8c4)

Change Thread
Stage 2 runs GRANT <role> TO CURRENT_USER after each CREATE ROLE (artifact_registry, iam-service, or iam-migrator). A non-superuser admin on PostgreSQL 16 or later can then create, dump, drop, and restore the databases. A superuser does not need it jdrpereira (pg_dump on Cloud SQL or RDS)
New backup step: save config.toml, the root key, and secrets.toml under umask 077, decoded from jsonpath, with an EMPTY: check. Other stage 3 keys are saved the same way and restored with their stage 3 create secret commands. Keep the CA files for trusted-ca. Do not use -o yaml jdrpereira (Secrets)
The GitLab activation record (artifact_registry_namespace_mappings) is listed as GitLab-side AR state. It must match the AR database: take the GitLab backup while AR is stopped, or make sure no org is activated between the two backups jdrpereira (mapping row)
Upgrading asks for a GitLab backup when GitLab moves. Roll back says to roll GitLab back too, from a matching backup. The closing line covers an org activated after the backup jdrpereira (rollout safety)
The bucket copy can also run once before the stop, to shorten the downtime jdrpereira (downtime)
One sentence: Redis may hold a few seconds of usage counts from before the rollback. No flush jdrpereira (Redis)
One Ingress note for helm upgrade and helm rollback. The --clean warning is cut to two lines. The pg_stat_activity query covers both databases. The kubectl apply claim is dropped from the Conflict note jdrpereira (nitpicks), Duo

Round 3 verification

Test Result
Exact stage 2 SQL (both variants), pg_dump, Roll back drop/create, and pg_restore from the guide, on postgres:16-alpine and postgres:18-alpine, as a superuser and as a non-superuser CREATEROLE CREATEDB admin 8/8 pass. Rows are restored, the newer table is gone, owners are unchanged, and the service roles can read and write. Without the GRANT, on PG16: must be able to SET ROLE, permission denied for table, and must be owner of database
Stray session during DROP DATABASE is being accessed by other users. The new query lists the session, and pg_terminate_backend clears it
Secret-save block from the guide, run in bash and zsh, in a scratch namespace on GKE with kubectl 1.36.3 (namespace deleted afterwards) Files match the source byte for byte, mode 600. A wrong ConfigMap name and a wrong key name both print EMPTY:. A Secret re-created from the saved file matches. Roll back step 4 replace restores the ConfigMap. A stale -o yaml copy fails replace with Conflict
https://docs.gitlab.com/charts/backup-restore/restore/ 200, "Restoring a GitLab installation"
vale --config .vale.ini, and markdownlint-cli2@0.22.1 0 errors. Per-message warning counts are the same as the previous head. markdownlint is clean

Related to gitlab-org/gitlab#634460 (closed). Upgrade order remains.

🤖 Generated with Claude Code

Edited by Suleimi Ahmed

Merge request reports

Loading
Loading