Skip to content
Back

Appwrite Upgrade 1.6.1 → 1.7.4

  • 0
  • 4
  • Self Hosted
  • Databases
Ericooooo
21 Aug, 2025, 12:36

Just upgraded my Appwrite instance from 1.6.1 → 1.7.4 and ran into some issues during the migration process. What I did:

  • Upgraded Appwrite to 1.7.4
  • Imported my backup using: sudo docker-compose exec -T mariadb sh -c 'exec mysql -u"$MYSQL_USER" -p"$MYSQL_PASSWORD"' < ./backups/appwrite-dump-20250820_131433.sql
  • Ran migration with docker compose exec appwrite migrate The Error I'm Getting:

    sudo docker compose exec appwrite migrate Starting Data Migration to version 1.7.4 [Error] Timestamp: 2025-08-21T12:24:44+00:00 [Error] Type: PDOException [Error] Message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'appwrite._console_devKeys' doesn't exist [Error] File: @swoole/library/core/Database/PDOStatementProxy.php

Questions:

Is this a known compatibility issue between these versions? Should I be running additional setup commands after restoring the database backup? Any suggestions on how to fix this missing table issue?

Any help would be much appreciated! 🙏

TL;DR
Missed upgrade from 1.6.1 to 1.6.2, imported backup post 1.7.4 upgrade causing errors. Solution is to restore to 1.6.1 backup, upgrade to 1.6.2 first, then 1.7.4. Creating dev keys manually in MariaDB resolved the issues. Also had to rename tables during migration and restart the container to complete the process successfully.
21 Aug, 2025, 14:37

You missed 1.6.2

21 Aug, 2025, 14:38

Imported backup after upgrading to 1.7.4? Why?

21 Aug, 2025, 14:39

You should restore to your 1.6.1 backup, upgrade to 1.6.2, and then 1.7.4

1
21 Aug, 2025, 23:37

i try it but i have the same error

22 Aug, 2025, 00:04

I created it manually and it seems to work

CREATE TABLE IF NOT EXISTS _console_devKeys ( _id varchar(255) NOT NULL, _createdAt datetime(3) DEFAULT NULL, _updatedAt datetime(3) DEFAULT NULL, _permissions mediumtext, projectInternalId varchar(255) DEFAULT NULL, projectId varchar(255) DEFAULT NULL, name varchar(255) DEFAULT NULL, secret varchar(512) DEFAULT NULL, expire datetime(3) DEFAULT NULL, accessedAt datetime(3) DEFAULT NULL, sdks longtext, PRIMARY KEY (_id), KEY _createdAt (_createdAt), KEY _updatedAt (_updatedAt), KEY projectInternalId (projectInternalId), KEY accessedAt (accessedAt) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS _console_devKeys_perms ( _id varchar(255) NOT NULL, _type varchar(12) NOT NULL, _permission varchar(255) NOT NULL, PRIMARY KEY (_id, _type, _permission), KEY _permission (_permission) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

22 Aug, 2025, 00:06

I have this now, but idk if it's a serious error or not Failed to update document "67f7fc48398859fd9918" in collection "rules":Invalid document structure: Unknown attribute: "region"

22 Aug, 2025, 00:09

But i still have a error 500 :/

23 Dec, 2025, 20:24

any solutions?

I have the same problem and I did upgrade from 1.6.1 -> 1.6.2 then migrate afterwards upgraded to 1.7.4 including migration - but still the same problem

Any Ideas?

23 Dec, 2025, 20:57

I now tried to upgrade from 1.6.2 -> 1.7.5 - here I got the same problem again.

After that I tried to upgrade from 1.6.2 -> 1.7.0 here I got this error:

''' Failed to update document "681f9a0994fc82193964" in collection "rules":Invalid document structure: Missing required attribute "region" Failed to update document "681f9b483a735d7bab56" in collection "rules":Invalid document structure: Missing required attribute "region" Failed to update document "681f9bd896b4b809d48b" in collection "rules":Invalid document structure: Missing required attribute "region" Failed to update document "681f9d2a429e8c09c1d4" in collection "rules":Invalid document structure: Missing required attribute "region" Failed to update document "681f9f3be00e0ab421a6" in collection "rules":Invalid document structure: Missing required attribute "region" Failed to update document "682316392d2d77092897" in collection "rules":Invalid document structure: Missing required attribute "region" Failed to migrate project "console" with error: Collection not found [Error] Timestamp: 2025-12-23T20:37:49+00:00 [Error] Type: Utopia\Database\Exception\NotFound [Error] Message: Collection not found [Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Database.php [Error] Line: 3188 [Error] Trace: #0 /usr/src/code/src/Appwrite/Migration/Version/V22.php(352): Utopia\Database\Database->getDocument(Object(Utopia\Database\Document), '675065cb0002607...') #1 /usr/src/code/src/Appwrite/Migration/Migration.php(177): Appwrite\Migration\Version\V22->migrateDocument(Object(Utopia\Database\Document)) #2 /usr/src/code/vendor/utopia-php/database/src/Database/Database.php(6123):

23 Dec, 2025, 20:57

Appwrite\Migration\Migration->Appwrite\Migrationclosure}(Object(Utopia\Database\Document)) #3 /usr/src/code/src/Appwrite/Migration/Migration.php(171): Utopia\Database\Database->foreach('rules', Object(Closure)) #4 /usr/src/code/src/Appwrite/Migration/Version/V22.php(38): Appwrite\Migration\Migration->forEachDocument(Object(Closure)) #5 /usr/src/code/src/Appwrite/Platform/Tasks/Migrate.php(93): Appwrite\Migration\Version\V22->execute() #6 /usr/src/code/vendor/utopia-php/cli/src/CLI/CLI.php(321): Appwrite\Platform\Tasks\Migrate->action('1.7.0', Object(Utopia\Database\Database), Object(Closure), Object(Utopia\Registry\Registry)) #7 [internal function]: Utopia\CLI\CLI->run() #8 {main}

24 Dec, 2025, 11:11

<@462046107556511744> merry christmas - I hope you can help me, this is a production server and it would be fatal if this Update will not work.

THanks - have some nice days.

best regards

24 Dec, 2025, 14:31

ok - I solved it!

I also added the dev keys manually in the mariadb - with this command:

TypeScript
CREATE TABLE IF NOT EXISTS `_console_devKeys` (
    `_id` varchar(255) NOT NULL,
    `_uid` varchar(255) DEFAULT NULL,
    `_createdAt` datetime(3) DEFAULT NULL,
    `_updatedAt` datetime(3) DEFAULT NULL,
    `_permissions` mediumtext,
    `projectInternalId` varchar(255) DEFAULT NULL,
    `projectId` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `secret` varchar(512) DEFAULT NULL,
    `expire` datetime(3) DEFAULT NULL,
    `accessedAt` datetime(3) DEFAULT NULL,
    `sdks` longtext,
    PRIMARY KEY (`_id`),
    KEY `_createdAt` (`_createdAt`),
    KEY `_updatedAt` (`_updatedAt`),
    KEY `projectInternalId` (`projectInternalId`),
    KEY `accessedAt` (`accessedAt`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS `_console_devKeys_perms` (
    `_id` varchar(255) NOT NULL,
    `_type` varchar(12) NOT NULL,
    `_permission` varchar(255) NOT NULL,
    PRIMARY KEY (`_id`, `_type`, `_permission`),
    KEY `_permission` (`_permission`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

ALTER TABLE `_console_rules` ADD COLUMN IF NOT EXISTS `region` VARCHAR(255) DEFAULT 'default';
ALTER TABLE `_console_buckets` ADD COLUMN IF NOT EXISTS `region` VARCHAR(255) DEFAULT 'default';
ALTER TABLE `_console_databases` ADD COLUMN IF NOT EXISTS `region` VARCHAR(255) DEFAULT 'default';

exit;
24 Dec, 2025, 14:33

after that I did

TypeScript
docker compose exec redis redis-cli flushall

then I was wondering if the migration would work - but it didn't... I git this error:

24 Dec, 2025, 14:33
TypeScript
appwrite  | Fatal error: Uncaught PDOException: SQLSTATE[42S01]: Base table or view already exists: 1050 Table '_console_devKeys' already exists in @swoole/library/core/Database/PDOStatementProxy.php:49

appwrite  | Stack trace:

appwrite  | #0 @swoole/library/core/Database/PDOStatementProxy.php(49): PDOStatement->execute()

appwrite  | #1 /usr/src/code/vendor/utopia-php/database/src/Database/Adapter/MariaDB.php(221): Swoole\Database\PDOStatementProxy->__call('execute', Array)
24 Dec, 2025, 14:40

So I was thinking - appwrite wants to create the dev Keys in the migration, so i added this:

TypeScript
INSERT INTO `_console_metadata` (`_uid`, `name`, `attributes`, `indexes`, `status`) 
VALUES ('devKeys', 'devKeys', '[]', '[]', 'available')
ON DUPLICATE KEY UPDATE status='available';

INSERT INTO `_console_metadata` (`_uid`, `name`, `attributes`, `indexes`, `status`) 
VALUES ('devKeys_perms', 'devKeys_perms', '[]', '[]', 'available')
ON DUPLICATE KEY UPDATE status='available';

exit;

after this I cleared the docker cache and restarted the container

TypeScript
docker compose exec redis redis-cli flushall && docker compose restart appwrite

now the migration was also not successful - so I renamed the tables into:

TypeScript
RENAME TABLE `_console_devKeys` TO `_console_devKeys_temp`;
RENAME TABLE `_console_devKeys_perms` TO `_console_devKeys_perms_temp`;

after that i restarted the container with

TypeScript
docker compose restart appwrite

and started the migration - NOW IT WAS SUCCESSFUL.

24 Dec, 2025, 14:40

Hope this helps someone in the future

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