Has anyone migrated from cockroach DB to Postgres for Zitadel running via docker? I’ve been trying but have been unsuccessful. Any guidance would be much appreciated!
Hey there @AYEEDITYA! Thanks for reaching out I'm sorry to hear you're experiencing an issue in the migration process. Could you provide some more clarity on what has been unsuccessful in the process so far?
setup my new config file, mirror file, secrets file and was able to initialize and setup my pg db to be migrated to. however when i run the mirror command:
I get the error: FATA[0000] unable to connect to destination database caller="/home/runner/work/zitadel/zitadel/cmd/mirror/system.go:41" error="ERROR: unrecognized configuration parameter "enable_multiple_modifications_of_table"(SQLSTATE 42704)"
I get this error immediately, both my databases are connecting just fine - CRDB with self signed certs and PGSQL with password auth. Init and setup is working fine with 0 errors.
Preflight Checklist I could not find a solution in the documentation, the existing issues or discussions I have joined the ZITADEL chat Environment Self-hosted Version v2.61.0 Database Other (descr...
Preflight Checklist 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 D...
I start my migration by setting up the new compose file with the additional pgsql container, modify my config.yml, mirror.yml and secrets.yml to accept the pgsql database. then I run: docker compose run zitadel init --config /mirror.yml --config /config.yml --config /secrets.yml
then I run the command: docker compose run zitadel setup --for-mirror --config /mirror.yml --config /config.yml --config /secrets.yml --masterkey dBtCBFdLWiGu5xcngBozqpLlfZMKwgUO --tlsMode external and get the output:
Finally, I run the mirror command: docker compose run zitadel mirror --system --config /mirror.yml --config /config.yml --config /secrets.yml --masterkey dBtCBFdLWiGu5xcngBozqpLlfZMKwgUO --tlsMode external to get the output:
Hey @Raccine, I also tried the same setup with an empty CRDB setup but I get the exact same results. Which IMO points to an issue with the mirror command itself. Not sure
Hey @Rajat Singh you seem quite active. Would you maybe have time to look into this? Or pass along with another team member? From the issues on GH, seems like I’m not the only one facing this issue. Thanks!
Thanks for providing all of this context and so sorry for the delay in response! An engineer will loop back with you tomorrow with a response after delving into the information you've provided :gigipixel:
hey @AYEEDITYA maybe this comment might help which leads to a fix lmk if it help or else feel free to update the GH threads so that someone from the team can have a look
This PR fixes issues to ensure the mirror command functions correctly by updating the projections configuration and related database settings. Additional Changes
Preflight Checklist 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.64.1 Database PostgreSQL Da...
Hey, I am not clear how it would help. I see the fix mentioned in 9509 was merged in V3 (was previsouly migrating with Zitadel V2.71.9. But using V3 results in:
FATA[0000] unable to copy encryption keys to destination caller="/home/runner/work/zitadel/zitadel/cmd/mirror/system.go:137" error="ERROR: duplicate key value violates unique constraint "encryption_keys_pkey"(SQLSTATE 23505)"
when i run the mirror command following the same flow I mentioned above
Preflight Checklist 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 D...