From 3721e6b95000dcded36649d19d53299e6fc5e0c1 Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Mon, 11 May 2026 16:42:22 +0100 Subject: [PATCH] fix(migrations): write _APP_MIGRATION_HOST in generated .env (install & upgrade) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The migrations worker (Appwrite→Appwrite migrations + CSV/JSON imports & exports) reads `_APP_MIGRATION_HOST` to call back into this instance's API. `_APP_MIGRATION_HOST` was introduced in #11229 (1.8.x / 1.9.x) but was never added to `app/config/variables.php`, so `appwrite install` / `appwrite upgrade` never write it into the generated `.env`. With the var unset, the migrations worker fails — on a fresh self-hosted install the first export hangs with no error (#11853). (Contributors and CI don't hit it because the repo's hand-maintained `.env` already has `_APP_MIGRATION_HOST=appwrite`; only the *installer-generated* `.env` is missing it.) Add `_APP_MIGRATION_HOST` to `app/config/variables.php` with default `appwrite` — the API service name in the standard Docker Compose setup, which is what the repo's own `.env` and the cloud Helm charts already use, and what the migration endpoint was hardcoded to before #11229. `appwrite install` and `appwrite upgrade` now write it into the generated `.env`, so fresh installs and upgrades have it set and the migration/import/export flows work. Scope: this PR fixes the install & upgrade paths only — it deliberately doesn't change the worker code. Fixes #11853 --- app/config/variables.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/config/variables.php b/app/config/variables.php index c834656ff4..90df9b4518 100644 --- a/app/config/variables.php +++ b/app/config/variables.php @@ -1336,6 +1336,15 @@ return [ 'category' => 'Migrations', 'description' => '', 'variables' => [ + [ + 'name' => '_APP_MIGRATION_HOST', + 'description' => 'Internal hostname the migrations worker uses to reach this instance\'s API (for migrations and CSV/JSON imports & exports). Defaults to \'appwrite\', the API service name in the standard Docker Compose setup. Only change this for non-standard deployments.', + 'introduction' => '1.9.0', + 'default' => 'appwrite', + 'required' => false, + 'question' => '', + 'filter' => '' + ], [ 'name' => '_APP_MIGRATIONS_FIREBASE_CLIENT_ID', 'description' => 'Google OAuth client ID. You can find it in your GCP application settings.',