docker
docker copied to clipboard
Database Restore Error
Hello Everyone
I am trying to upgrade to calcom
I toke a backup for our database from inside the container using
"docker exec -i postgres /usr/bin/pg_dump
-U <postgresql_user> <postgresql_database> > postgres-backup.sql "
then I pulled the latest repo and edited the env file and build the image, every thing worked good and services started correctly.
The issue is when I try to restore the old backup to the new DB I get this error
I even Tried to drop the db then creating it again and restore then I get this error from the dashboard
Any help would be appreciated
@zomars @PeerRich should issues like these be encouraged to be moved to the core repos? @monzer94 if you're able to convert those images back to the embedded images instead of google drive, it would be helpful for archiving.
thanks!
@zomars @PeerRich should issues like these be encouraged to be moved to the core repos? @monzer94 if you're able to convert those images back to the embedded images instead of google drive, it would be helpful for archiving.
thanks!
Could you please help with that, sorry but i am new to open issues in github
fixed images.
no this is a docker issue, not core, no?
it seems like a migration is missing?
it seems like a migration is missing?
From what I read in the discussion, the migration should start automatically once I run the services. Is there anything from my end I can try?
The docker image runs the same migrations as the core project and doesn't do anything differently there, that's why I think it may be an issue in core. It isn't desired, but are you able to try running the core project outside of docker and configure it for your database to see if you have the same issue?
no I didn't try that, but what I just found right now, the migration is running and it detect 120 migration but it exits on a command "yarn run dp=deploy exited" and then it enter in loop of this error "P3009" https://drive.google.com/file/d/1ePN8PGS-qecOAH66D1CwiId-DdUCJkEI/view?usp=sharing
Just thinking out loud here as I'm no docker expert, but it seems to me the problem is you're trying to restore a backup from a different version of cal, into a new version of cal, you should make it the inverse I think, upgrade your database to latest (version you want to run), then back it up, and then import that into the latest running version on docker.
Otherwise the databases won't match, and thus you cannot import the backup safely into a database with different shape.
Let us know if that worked for you!
Best regards, Agusti
I checked the postgres db version on the old and the new cal version and they are both 14.0
https://drive.google.com/file/d/1QqS1p4lXo-EoTtZZOVjvYrfOd6EgREZx/view?usp=sharing
I checked the postgres db version on the old and the new cal version and they are both 14.0 drive.google.com/file/d/1QqS1p4lXo-EoTtZZOVjvYrfOd6EgREZx/view?usp=sharing
Yeah, sorry I should probably been clearer, I meant cal app version. not postgresql version. Since at each release we might change the tables and columns of the database, and so if you try to make a backup in one version of cal into a newer one, the tables mismatch and the backup can't proceed
Ok, and sorry if this is a beginner question, but how to update my cal version, because the only thing I found related to the docker deployment is pull the latest and upgrade, could you please help me with that.
you could try to run yarn prisma db push or yarn prisma db deploy on your current database (after backing it up, in case it breaks something), that should migrate your current data to latest version I think. After upgrading to latest version you want of course
This prisma docs link might be of help https://www.prisma.io/docs/guides/database/patching-production
you could try to run yarn prisma db push or yarn prisma db deploy on your current database (after backing it up, in case it breaks something), that should migrate your current data to latest version I think. After upgrading to latest version you want of course
So on the old cal I am running prisma v2 while in the new cal they are running prisma v3, so you suggest to upgrade old cal prisma to the same version then backup and restore right?
Hi I try to upgrade the prisma on the old cal then do run yarn prisma db pushm but the db wont update some rows and tables, please any idea to help