Skip to main content

Upgrade Existing Git Backends

The official Helm chart upgrades existing Git-backed Projects automatically. For a normal upgrade, change the chart and image versions in your values or GitOps repository and deploy as usual. Do not disable the worker, disable CaSC, or run a migration command for each Project.

Existing CaSC values that contain branch, auto_push, auto_pull, or sync_on_create remain valid during the compatibility window. Synth converts the persisted Project metadata before the web process or ingestion worker starts. You can update those values to the canonical form in the same release or in a later cleanup change.

This automatic startup migration covers Git backend metadata, not legacy authorization. RBAC v2 is now the default: before upgrading unmigrated legacy auth state, follow Users & Access and set the explicit legacy compatibility override. Already migrated auth state needs no RBAC override on a v2-default image.

What makes the Helm upgrade safe​

The chart supports one standalone-pvc application pod and uses the Kubernetes Recreate strategy. During an upgrade, Kubernetes stops the old pod first. An init container in the replacement pod then performs this ordered startup gate:

  1. Discover every registered Project and every Project under the configured Projects directory.
  2. Back up and atomically convert legacy Git backend metadata without contacting GitHub, GitLab, or the repository.
  3. Apply the mounted CaSC document, accepting either legacy or canonical Git fields.
  4. Start the web and ingestion-worker containers only after both steps succeed.

This prevents an old worker from observing the new schema and prevents the new worker from racing the conversion. The migration is idempotent, so Kubernetes can retry the init container safely.

The startup gate fails closed if a Project has corrupt or ambiguous metadata. The application does not start with a configuration that could be interpreted as the wrong update method or target.

Normal Helm or GitOps upgrade​

Keep your existing Project values and update the release versions through your normal deployment process. For example:

image:
tag: <new-version>

Then apply the release normally:

helm upgrade --install synth <chart> \
--namespace synth \
--reuse-values \
--set image.tag=<new-version> \
--wait \
--timeout 10m

For Argo CD, update the chart version and image tag in Git and sync the Application. No temporary worker or CaSC settings are required.

If your GitOps setup vendors the chart and image setting in separate repositories, update the chart first and the image second. The chart detects an older image that does not contain the migration command, leaves existing Project state untouched, and defers CaSC. Selecting the new image then runs the full migration and CaSC gate before the application starts. This compatibility check makes the brief chart-first state safe; do not leave the deployment in that intermediate state as its steady configuration.

Existing values and their exact result​

This existing configuration can be upgraded unchanged:

synth:
projects:
- name: team-docs
backend:
type: git
config:
remote_url: https://gitlab.example.com/acme/knowledge.git
branch: main
auto_push: true
auto_pull: true
sync_on_create: true
project_subdir: projects/team-docs
credential_id: gitlab-knowledge-repo

Synth preserves its behavior and layout as:

remote_url: https://gitlab.example.com/acme/knowledge.git
update_method: direct
target_branch: main
project_subdir: projects/team-docs
credential_id: gitlab-knowledge-repo

The conversion rules are:

Existing valueUpgrade result
no update methodupdate_method: direct, preserving the previous behavior
branch: releasetarget_branch: release
no branchtarget_branch: main, preserving the old effective target
auto_push: true or omittedbackground updates remain active
auto_push: falsebackground updates remain paused
auto_pullremoved; it did not schedule repository pulls
sync_on_create on an existing Projectremoved and not replayed during upgrade
no project_subdirthe existing repository-root layout is preserved

The migration does not move repository content, clone, pull, push, create a branch, or open a pull or merge request.

Choose a different update method in values​

Users still control how successful ingestions update the repository. To change an existing Project from its previous direct update behavior, replace the legacy fields in chart values with the chosen canonical method:

synth:
projects:
- name: team-docs
backend:
type: git
config:
remote_url: https://gitlab.example.com/acme/knowledge.git
credential_id: gitlab-knowledge-repo
update_method: pullRequest
target_branch: main
project_subdir: projects/team-docs
auto_merge: false

Use pullRequest for a GitHub pull request or GitLab merge request, direct for a verified update to the target branch, or branch when another process will promote Synth's branch. The value is deliberately the same for GitHub, GitHub Enterprise, GitLab.com, GitLab Dedicated, and GitLab Self-Managed.

Pause is operational Project state, not a chart setting. An existing auto_push: false is converted to that state once and remains paused until an authorized user resumes it.

Verify an upgrade​

Watch the replacement pod and require the init container to complete:

kubectl -n synth get pods -w
kubectl -n synth logs deploy/synth -c import-casc-config
kubectl -n synth rollout status deploy/synth --timeout=10m

The init log contains a JSON report with the discovered Projects and how many were migrated. For each migrated Project, Synth retains:

  • the original metadata at <project>/.synth/migration-backups/git-backend-updates-v1/metadata.json;
  • an idempotency receipt at <project>/.synth/git-backend-migration-v1.json; and
  • the previous active or paused state in the Project-local update control.

After the pod is ready, open Projects → Storage and confirm the update method, target branch, repository folder, and pause state. A normal version-only upgrade does not itself update the remote repository; the next successful ingestion follows the preserved method.

If the init container stops the rollout​

Read its log before changing anything:

kubectl -n synth logs <new-pod> -c import-casc-config

Common causes are invalid or ambiguous Project metadata and an unregistered enterprise Git host. Correct the chart values or Project metadata choice and let Kubernetes retry. Successfully converted Projects do not change again.

The server command synth project migrate-git-backend remains available for diagnosis and recovery in custom deployments. It is not part of the normal Helm upgrade.

Custom deployments​

Deployments that do not use the official chart must provide the same ordering: stop every old web/worker process, run python -m synth.core.git_backend_migration --all, apply CaSC, and then start only the new processes. Never run the automatic migration while an old worker can access the same Project storage.

Prefer a forward fix after migration. Rolling back to an old runtime is safe only after restoring legacy metadata in a paused state and reviewing queued updates; old runtimes do not understand pullRequest or branch semantics.

See Remote Git Backends for the canonical configuration and normal operations.