Back

[SOLVED] Upgrade to 1.3.3 From 1.0.3 Migrate not work

  • 0
  • Self Hosted
  • Databases
Milukun
4 May, 2023, 03:04

I upgraded based on this document https://appwrite.io/docs/upgrade#install-new-version

The first step performed the upgrade:

TypeScript
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.3

The second step performs the migration:

TypeScript
cd appwrite/
docker compose exec appwrite migrate
TypeScript
13300 / 13437
13400 / 13437
13437 / 13437
Migrating Collection realtime:
0 / 0
Migrating Collection cache:
0 / 0
Migrating Collection variables:
0 / 0
Migrated 2/2 projects...
Data Migration Completed

After this done , I can not create new project

And got error:

TypeScript
Failed: Invalid document structure: Unknown attribute: "region"
#0 /usr/src/code/src/Appwrite/Usage/Calculators/TimeSeries.php(421): Utopia\Database\Database->createDocument(Object(Utopia\Database\Document), Object(Utopia\Database\Document))
#1 /usr/src/code/src/Appwrite/Usage/Calculators/TimeSeries.php(503): Appwrite\Usage\Calculators\TimeSeries->createOrUpdateMetric('1', '2023-05-04T00:0...', '1d', 'documents.63410...', 2, 0)
#2 /usr/src/code/src/Appwrite/Usage/Calculators/TimeSeries.php(528): Appwrite\Usage\Calculators\TimeSeries->syncFromInfluxDB('documents.datab...', Array, Array)
#3 /usr/src/code/app/tasks/usage.php(132): Appwrite\Usage\Calculators\TimeSeries->collect()
#4 /usr/src/code/vendor/utopia-php/cli/src/CLI/Console.php(208): {closure}()
#5 /usr/src/code/app/tasks/usage.php(137): Utopia\CLI\Console::loop(Object(Closure), 30)
#6 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(233): {closure}()
#7 /usr/src/code/app/cli.php(32): Utopia\CLI\CLI->run()

It seems like Migrate not work

docker-compose exec appwrite doctor

see doctor.log

TL;DR
Solution: The user had an issue with the migration after upgrading from version 1.0.3 to 1.3.3. The solution is to follow the documentation and not skip minor versions during the upgrade process. To fix the issue, the user ran the following commands: ``` docker compose exec appwrite migrate version=1.1.2 docker compose exec appwrite migrate version=1.2.1 docker compose exec appwrite migrate version=1.3.3 ``` If restoring is not possible, the user can try migrating to each version using the above commands. It is recommended
Milukun
4 May, 2023, 03:06

What remedial measures should I take now? I already have a Project with 80K data and I don't want to lose the data.

Drake
4 May, 2023, 03:10

If you care about your data, you should always backup before and test the upgrade before doing it on your production instance

Drake
4 May, 2023, 03:14

As the docs state, you can't skip minor versions.

It would be best to restore and upgrade to each version, running the migrate command on each version:

  1. 1.1.2
  2. 1.2.1
  3. 1.3.3

If you can't restore, you can try to migrate like this now:

TypeScript
docker compose exec appwrite migrate version=1.1.2
docker compose exec appwrite migrate version=1.2.1
docker compose exec appwrite migrate version=1.3.3
Milukun
4 May, 2023, 03:17

Thank you so much! These three commands saved me 🥹

TypeScript
docker compose exec appwrite migrate version=1.1.2
docker compose exec appwrite migrate version=1.2.1
docker compose exec appwrite migrate version=1.3.3
Drake
4 May, 2023, 03:21

[SOLVED] Upgrade to 1.3.3 From 1.0.3 Migrate not work

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