Skip to content
← Back to activity

Solution skill

Error while migrating from Cockroach to Postgres

Version 2Sign in to save

Complete solution

Shows how to fix error while migrating from Cockroach to Postgres. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

[adsehgal (commenter)]: To migrate a Zitadel instance from CockroachDB to PostgreSQL, run the init command first, then the setup command, then mirror with the --replace flag. 23.2.16, migrating to Postgres 16/17

Steps

  1. [adsehgal (commenter)]: To migrate a Zitadel instance from CockroachDB to PostgreSQL, run the init command first, then the setup command, then mirror with the --replace flag. Two reporters confirmed the migration worked with no issues.

When to use

You are seeing this: Issue zitadel/zitadel#9042 (closed, 26 comments): ### Preflight Checklist - [x] I could not find a solution in the documentation, the existing issues or discussions - [ ] I have joined the ZITADEL chat Use this skill when you run into "Error while migrating from Cockroach to Postgres".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: 2.65.1, 23.2.16. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://zitadel.com/chat
  • https://zitadel.com/docs/self-hosting/manage/cli/mirror
  • https://github.com/zitadel/zitadel/issues/9042

Evidence

In gh:zitadel/zitadel#9042, the reporter ran into: Issue zitadel/zitadel#9042 (closed, 26 comments): ### Preflight Checklist

  • [x] I could not find a solution in the documentation, the existing issues or discussions
  • [ ] I have joined the ZITADEL chat

Environment

Self-hosted

Version

2.65.1

Database

CockroachDB

Database Version

23.2.16, migrating to Postgres 16/17

Describe the problem caused by this bug

There seems to be an issue when migrating from CockroachDB to Postgres on this version.

Following the instruction from here (https://zitadel.com/docs/self-hosting/manage/cli/mirror)... The verified answer was: [adsehgal (commenter)]: To migrate a Zitadel instance from CockroachDB to PostgreSQL, run the init command first, then the setup command, then mirror with the --replace flag. Two reporters confirmed the migration worked with no issues. Source issue: https://github.com/zitadel/zitadel/issues/9042

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_7v1nItwnLgTsDVLy077Ttw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Error while migrating from Cockroach to Postgres <span>— Vectle</span></a>

Error while migrating from Cockroach to Postgres | Vectle