Back

How to restore the database after upgrade failure

  • 1
  • Databases
Drake
23 Sep, 2023, 04:21

It shouldn't as long as the folder is still named the same. And then you ran the upgrade command while in the api folder, right?

TL;DR
User is experiencing errors after upgrading the database. User ran the migrate command without the -v flag and now data might be lost. User ran the upgrade command in the correct folder. Solution: Check if data is still present and verify that the .env and docker-compose.yml files were updated correctly.
yongbi
23 Sep, 2023, 04:25

yes

Drake
23 Sep, 2023, 04:25

And that created new docker-compose.yml files and it has Appwrite 1.4.3 in there?

Drake
23 Sep, 2023, 04:27

Does the new .env file look okay?

yongbi
23 Sep, 2023, 04:32

The files including .env and docker-compose.yml were moved from the old directory. Not created newly.

yongbi
23 Sep, 2023, 04:33

How do I confirm it?

Drake
23 Sep, 2023, 04:34

Huh? I don't understand

yongbi
23 Sep, 2023, 04:38

I mean the files were updated form the old version.

yongbi
23 Sep, 2023, 04:43

The version of appwrite is 1.4.3 now

Drake
23 Sep, 2023, 04:44

And the .env file looks okay?

yongbi
23 Sep, 2023, 04:44
yongbi
23 Sep, 2023, 04:46

Yes. Its content is almost the same as my local one.

Drake
23 Sep, 2023, 04:50

Nice. So what exactly happened when you ran the migrate command?

yongbi
23 Sep, 2023, 04:51
yongbi
23 Sep, 2023, 04:51

logs here.

Drake
23 Sep, 2023, 04:53

You didn't run down with -v did you?

Drake
23 Sep, 2023, 04:54

What are the docker logs from the appwrite container?

Drake
23 Sep, 2023, 04:55

How many times did you run the migrate command?

yongbi
23 Sep, 2023, 04:58

Sorry, I forgot it. I run it with -v very likely.

yongbi
23 Sep, 2023, 04:58

2

yongbi
23 Sep, 2023, 04:59

Many errors like this.

yongbi
23 Sep, 2023, 04:59
TypeScript
appwrite  | [Error] Timestamp: 2023-09-23T04:55:38+00:00
appwrite  | [Error] Method: GET
appwrite  | [Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents
appwrite  | [Error] Type: Appwrite\Extend\Exception
appwrite  | [Error] Message: Project with the requested ID could not be found. Please check the value of the X-Appwrite-Project header to ensure the correct project ID is being used.
appwrite  | [Error] File: /usr/src/code/app/controllers/general.php
appwrite  | [Error] Line: 294appwrite  | [Error] Timestamp: 2023-09-23T04:55:38+00:00
appwrite  | [Error] Method: GET
appwrite  | [Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents
appwrite  | [Error] Type: Appwrite\Extend\Exception
appwrite  | [Error] Message: Project with the requested ID could not be found. Please check the value of the X-Appwrite-Project header to ensure the correct project ID is being used.
appwrite  | [Error] File: /usr/src/code/app/controllers/general.php
appwrite  | [Error] Line: 294
yongbi
23 Sep, 2023, 05:00

So has all my data been lost?

Drake
23 Sep, 2023, 05:01

-v deletes all your data 😭

yongbi
23 Sep, 2023, 05:07

😒

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