Skip to content
Back

Migration Failed from 1.7.4 β†’ 1.8.1: "Collection not found" error on sites collection

  • 0
  • Self Hosted
  • Sites
  • General
hey ameen
3 Feb, 2026, 19:31

Hey everyone! πŸ‘‹

I'm trying to upgrade my self-hosted Appwrite from 1.7.4 to 1.8.1 and the migration is consistently failing

Environment:

  • Current version: 1.7.4
  • Target version: 1.8.1
  • Deployment: Self-hosted on Dokploy (modified docker-compose)
  • Database: MariaDB 10.11

The Error: Migration fails during document migration phase with:

TypeScript
Failed to migrate project with error: Collection not found
[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: 7225

The error occurs in Migration.php(178) β†’ V23.php(63) when trying to process the sites collection.

What I Found:

  • βœ… Sites collection exists globally: _8_sites table present in MariaDB
  • βœ… Sites metadata is properly defined in _8__metadata
  • βœ… The sites table is empty (0 records) - I never used the sites feature
  • βœ… All other collections migrated successfully (databases, users, buckets, etc.)
  • ❌ Migration script tries to iterate over project-level sites documents that don't exist
  • ❌ Error happens in the foreach('sites', ...) call

What Works:

  • All my actual data (collections, documents, buckets) migrated successfully
  • Rolling back to 1.7.4 works fine with the partially migrated database
  • The only failure is on the sites collection (a new 1.8.x feature I never used)

Questions:

  1. Has anyone else hit this migrating from 1.7.4 β†’ 1.8.1?
  2. Is there a workaround for the sites collection migration issue?
  3. Should I upgrade through intermediate versions (1.7.5, 1.8.0) if they exist?
  4. Is this a known bug that might be fixed in 1.8.2?

Attempted Solutions:

  • Running migrate multiple times (same error every time)
  • Manually updating version flag to 1.8.1 (caused additional internalId attribute errors)
  • Verified sites collection exists and is properly defined, just the migration logic fails on empty collection

Any help appreciated!

TL;DR
Self-hosted Appwrite upgrade from 1.7.4 to 1.8.1 is failing due to a "Collection not found" error on the sites collection during migration. The issue seems to be related to project-level sites documents that don't exist, causing errors in the migration script. It's a known issue when upgrading with unused sites feature. Rolling back to 1.7.4 works fine. No clear workaround aside from manually editing fails during migration script.
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