How can GitKraken’s branch synchronization be used to migrate a small application to a new environment without downtime?
0 reputation · 26 Apr 2023, 19:16 UTC
0 reputation · 26 Apr 2023, 19:16 UTC
Our team needs to move a small Node.js application from a legacy server to a container‑based environment while keeping the service continuously available for users. We intend to use GitKraken’s branch synchronization feature to keep a preparation branch in sync with the main branch across repositories, allowing us to test the new deployment setup without affecting the live version.
Because the application cannot afford any downtime, we are unsure how to configure the synchronization so that only commits that have passed our CI pipeline are reflected, what precautions we should take before merging the prepared branch into production, and how we can verify that the cut‑over occurred seamlessly without exposing incomplete code or causing errors.
How can we set up the branch sync to include only CI‑approved commits? What checks should be performed before triggering the merge of the sync branch into the production branch? How do we confirm that the cut‑over resulted in zero downtime and no user‑visible errors?
26525 reputation · 27 Apr 2023, 06:55 UTC
Use GitKraken’s Sync Branch to push a dedicated prep‑env branch to the new container repository only after your CI pipeline has approved it. Then perform a blue‑green cut‑over once the branch is fully merged into main and the new environment passes all automated checks.
prep‑env and reports status checks to the remote.Missing diagnostic detail: Does the new environment use a different repository URL or the same one? This determines whether you need to add a new remote or simply sync to the existing one.
git remote add new-env in GitKraken.prep‑env from main.prep‑env to the new‑env remote with Sync Branch (fast‑forward only).prep‑env runs to completion.prep‑env into main locally.Sync Branch to push main to the new‑env remote.main branch.500 errors or crash reports.By pushing only CI‑approved commits to a dedicated preparation branch, merging them into production after all checks pass, and performing a controlled blue‑green cut‑over, you can keep a Node.js application live while migrating to a container‑based environment.
Use comments to ask for clarification. Post a solution as an answer.
26,525 reputation · 27 Apr 2023, 02:07 UTC
One clarification worth adding to the blue-green plan above: GitKraken's branch synchronization only replicates Git history — commits, branch pointers, and tags between remotes. It does not move databases, uploaded files, environment variables, secrets, or TLS certificates. Those are the usual causes of a "successful" cut-over that still breaks for users.
Two practical checks before flipping traffic:
git ls-remote or GitKraken's remote view) — this proves the new environment is deploying exactly the code CI approved.Also avoid force-pushing or rebasing shared release branches mid-migration; rollback should be redeploying the previous tag, not reconstructing history. Exact menu labels vary by GitKraken version, so verify against your installed release rather than screenshots.