Back

SelfHosted - Migration errors : 1.2.1 -> 1.3.0

  • 1
  • Self Hosted
isstiaung
21 Mar, 2024, 08:42

We have a live version of appwrite that was running on 1.2.1, we want to migrate to appwrite cloud but, in order to do that we have to migrate to 1.4.x. To do this, we're upgrading from 1.2.1 to 1.3.0

While doing this in step 2 of the migration as per https://appwrite.io/docs/advanced/self-hosting/update

We're getting the following error

TypeScript
Migrating Collection cache:

Fatal error: Uncaught Exception: Collection not found in /usr/src/code/vendor/utopia-php/database/src/Database/Database.php:3827
Stack trace:
#0 /usr/src/code/src/Appwrite/Migration/Migration.php(162): Utopia\Database\Database->count(Object(Utopia\Database\Document))
#1 /usr/src/code/src/Appwrite/Migration/Migration.php(126): Appwrite\Migration\Migration->documentsIterator('cache')
#2 {main}
  thrown in /usr/src/code/vendor/utopia-php/database/src/Database/Database.php on line 3827

Current appwrite version : 1.3.0, previous appwrite version 1.2.1 Running on an ubuntu 22.04 server

docker ps output seems fine, all containers are up

TL;DR
Troubleshooting migration issues from version 1.2.1 to 1.3.0 in a self-hosted environment. Attempted unsuccessfully to run migrations. Received a fatal error related to a missing collection. Proposed solution: try clearing cache tables and running migrations sequentially for each version (1.2.1, 1.3.0, etc.) while ensuring backups are in place.
isstiaung
21 Mar, 2024, 08:42

Any suggestions on how we can get this migration done? We really want to move to cloud

isstiaung
21 Mar, 2024, 08:43

Also, once we run the migration, ssl seems to be down, how do I do get this back up ?

Ernest
21 Mar, 2024, 08:49

What command did you use for the upgrade to 1.3.0?

isstiaung
21 Mar, 2024, 08:52

docker run -it --rm --volume /var/run/docker.sock:/var/run/docker.sock --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw --entrypoint="install" appwrite/appwrite:1.3.0

isstiaung
21 Mar, 2024, 08:52

followed by

TypeScript
cd appwrite/
docker compose exec appwrite migrate
Ernest
21 Mar, 2024, 08:59

Hmm. Have you tried bringing down and up the containers then running the migration again?

isstiaung
21 Mar, 2024, 09:42

I see, I tried looking into that, but, there's no data in any of the cache tables

isstiaung
21 Mar, 2024, 09:43

and i continue to get this error

D5
21 Mar, 2024, 10:07

Do you have backups?

isstiaung
21 Mar, 2024, 10:07

Yes we do

isstiaung
21 Mar, 2024, 10:20

Are there any commands you recommend I run ?

D5
21 Mar, 2024, 11:34

You should come back to 1.2.1 and restore backups. You can't go to 1.5 directly, and instead you need to go to the corresponding paths like the latest 1.2.x version and run migrations, then 1.3.8 and run migrations, 1.4.14 and run migrations and then 1.5.3 and run migrations

isstiaung
21 Mar, 2024, 11:35

i tried moving back to 1.2.1 with a backup docker compose file i had

isstiaung
21 Mar, 2024, 11:35

this was after that

D5
21 Mar, 2024, 11:35

You can't migrate back. Did you have done a backup of just the docker compose file?

isstiaung
21 Mar, 2024, 11:36

No i have one of the db as well

isstiaung
21 Mar, 2024, 11:36

Let me try a new instance and get back

isstiaung
21 Mar, 2024, 11:36

With the db backup + the compose file

D5
21 Mar, 2024, 11:36

I would suggest a new instance of 1.2.1 and then restore the DB backup

D5
21 Mar, 2024, 11:38

You will need to have the openSSL key you set at first to be able to login and everything

isstiaung
21 Mar, 2024, 11:39

Yep I have a backup of all the default + configs I used to bring the containers up the first time

D5
21 Mar, 2024, 11:39

Keep the backup always for just in case

isstiaung
21 Mar, 2024, 11:39

Cool, will try it out and get back. Thank you!

ideclon
21 Mar, 2024, 21:02

Shouldn't the entrypoint be upgrade?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more