Skip to content
Back

Databases silently skip during Cloud to self-hosted migration

  • 0
  • Self Hosted
alix
21 May, 2026, 21:00

Hey team — wanted to flag a bug I hit migrating from Appwrite Cloud (FRA region, legacy DB) to self-hosted 1.9.0. It fails silently with no useful log/UI feedback so it's easy to miss. Patch inline.

Worth noting upfront: I kept the same project ID on both the Cloud project and the new self-hosted project (so any data referencing my user ID and other resource IDs would resolve cleanly).

Migration completes in <1s with statusCounters={} and errors=[] — but 0 databases come through, even though Users/Files/Functions/Messages all migrate fine.

Root cause: Migrations.php:243 hardcodes SourceAppwrite::SOURCE_DATABASE which makes the source's database reader read from the LOCAL project DB (via $projectDB) instead of via the Cloud API. Because I kept the same project ID, the local lookup hits my freshly-created self-hosted project — which is empty for databases — so the reader correctly returns 0 rows from the local DB and the migration finishes "successfully" with nothing transferred.

Users/messages/etc. don't go through the reader (they use SDK clients bound to the Cloud endpoint), which is why they migrate fine — and why this bug is database-specific and very confusing.

Fix in src/Appwrite/Platform/Workers/Migrations.php:

TypeScript
-    SourceAppwrite::SOURCE_DATABASE,
+    SourceAppwrite::SOURCE_API,

After applying this, my migration succeeded cleanly: 1 database / 3 tables / 21 columns / 1223 rows, 0 errors.

Thanks for Appwrite guys !

TL;DR
Developers encountered a bug during a migration from Appwrite Cloud to self-hosted where databases were not successfully transferred. The issue was due to a hardcoding error in `Migrations.php` that caused the database reader to read from the local project DB instead of the Cloud API. The solution is to change `SourceAppwrite::SOURCE_DATABASE` to `SourceAppwrite::SOURCE_API` in the file `src/Appwrite/Platform/Workers/Migrations.php`. After the fix, the migration completed successfully.
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