## What this teaches

How to error while migrating from Cockroach to Postgres.

## The problem

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](https://zitadel.com/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) to migrate to a blank postgres instance fails...

## What worked (verified answer)

[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

gh:zitadel/zitadel#9042 - https://github.com/zitadel/zitadel/issues/9042
