upgrading from v2.65.10 to v2.66.0 error at setup
Hello i am upgrading our zitadel infrastructure to the newest version. Right now i have a problem upgrading from v2.65.10 to v2.66.0. i get the following error in the logs:
zitadel-1  | time="2025-10-09T11:09:44Z" level=info msg="starting migration" caller="/home/runner/work/zitadel/zitadel/internal/migration/migration.go:66" name=40_init_push_func
zitadel-1  | time="2025-10-09T11:09:44Z" level=info msg="execute statement" caller="/home/runner/work/zitadel/zitadel/cmd/setup/40.go:41" file=40_init_push_func.sql migration=40_init_push_func
dzitadel-1  | time="2025-10-09T11:09:44Z" level=error msg="migration failed" caller="/home/runner/work/zitadel/zitadel/internal/migration/migration.go:68" error="40_init_push_func 40_init_push_func.sql: ERROR: at or near "(": syntax error (SQLSTATE 42601)" name=40_init_push_func
zitadel-1  | time="2025-10-09T11:09:45Z" level=fatal msg="migration failed" caller="/home/runner/work/zitadel/zitadel/cmd/setup/setup.go:261" error="40_init_push_func 40_init_push_func.sql: ERROR: at or near "(": syntax error (SQLSTATE 42601)" name=40_init_push_func
as database i have cockroachdb v22.2.19
13 Replies
Hi @boblack_zocker, I'm an AI assistant for ZITADEL. While a team member reviews this question, I'll see if I can find relevant sources for your question.
Answer
I wasn't able to find a direct answer, here are some relevant sources:
1. Stuck on "migration already started, will check again in 5 seconds" : This discusses using 
zitadel setup cleanup to resolve stuck migrations, which may help if your migration gets stuck after the current error (1)  .
2. migration error updating from 2.20.2 to 2.22.3 : Shows similar migration issues during upgrades and suggests trying the zitadel setup cleanup command when migrations fail (2)  .
I'd suggest clicking the "Ask for help" button to tag a team member who can review this specific migration error with the 40_init_push_func step.
ā
To learn more, see the sources I considered:
[1] Stuck on "migration already started, will check again in 5 seconds"
[2] migration error updating from 2.20.2 to 2.22.3
ā
Feel free to tag @Ask Inkeep with additional questions.
Got it. Tagging @Rajat for additional help.hey @boblack_zocker can you pls give me more context?. What commands did you ran, what did you expect?. Thanks
Hey,
so for the context:
Our zitadel is running on a old version v2.65.10. We want to update to the newest version. We use docker compose.
How i am doing this:
edit version in the compose file 1 version higher. so in my case to v2.66.0.
then i run "zitadel setup".
now in the process "zitadel setup" i ran into this error above.
What also could help me if u cant help with the script failure:
Is there a way to not update zitadel but instead import all the settings and users to a newly built zitadel v4. (surely only if this is possible)
my aim is to get to the latest version
hey @boblack_zocker I think the easiest way would be to migrate users which pretty much migrates everything that a user needs.
yes i thought about this too. i am locally testing right now how this here is working: https://zitadel.com/docs/guides/migrate/sources/zitadel#use-file
would this work to upgrade from v2 to v4?
is there a documentation where i can find the error codes and what they are for? because i could export all into a file but now i struggle to import it on the new instance
i think i found out now
i found a mistake in the documentaion @Rajat 
https://zitadel.com/docs/guides/migrate/sources/zitadel#import-from-file
Here it says to send the object as "data_orgsv1"
But if you go to the api documentation its not "data_orgsv1" but its "dataOrgsv1"
https://zitadel.com/docs/apis/resources/admin/admin-service-import-data
thats why it didnt work rigth away for me š
hmm. its still not working
what could be the reason?

hey @boblack_zocker it maybe habe to do with the 
export.json file, could you please share just ONE of the user data so I can try running it against my cluster?."humanUsers": [ 
{
                    "userId": "205336722215534595",
                    "user": {
                        "userName": "blabladominik23@muellmail.com",
                        "profile": {
                            "firstName": "Dominik",
                            "lastName": ">B",
                            "displayName": "Dominik >B",
                            "preferredLanguage": "und"
                        },
                        "email": {
                            "email": "blabladominik23@muellmail.com",
                            "isEmailVerified": true
                        },
                        "hashedPassword": {
                            "value": "$2a$14$hwOvUDw6P0CUqfSqjFE.g.29GWm0x5h5iVPWeD9DKILfAO1gMfMVy"
                        }
                    }}
]
this are testdata so not tragic
But to clarify, are we talking about the same api? because i talk about this import/export process: https://zitadel.com/docs/guides/migrate/sources/zitadel#use-file
and i think you talk about this here: https://zitadel.com/docs/guides/migrate/users
hey @boblack_zocker good morning!. I will try both of endpoints, no worries
ā¤ļø
hey @boblack_zocker but this was the command that you were struggling with correct?.
I adjusted your json body
let me know if this works š
I was able to login too(I changed the password as idk the hashed value)

alrigth i will test out if i can import it tomorrow. thanks š
hey @Rajat i tested it out. looks like its working now š„³