@@ -46,8 +46,8 @@ The full breaking-change list is in [CHANGELOG.md](CHANGELOG.md) under
4646- ** Symfony env vars lose the ` APP_ ` prefix** (except ` APP_ENV ` and ` APP_SECRET ` , which Symfony
4747 defines). ` APP_DATABASE_URL ` becomes ` DATABASE_URL ` , ` APP_JWT_PASSPHRASE ` becomes
4848 ` JWT_PASSPHRASE ` , etc. The 2.8 API ships ` app:utils:convert-env-to-3x ` , which does the rename
49- for you (and converts the admin/client ` config.json ` ) — this repo's ` task upgrade_prep ` runs
50- it; see the pre-upgrade checklist below.
49+ for you (and converts the admin/client ` config.json ` ) — this repo's ` task env_migrate ` (on the
50+ 1.x branch) runs it; see the pre-upgrade checklist below.
5151- ** One env file per service.** The single ` .env.docker.local ` is gone, replaced by
5252 ` .env.symfony ` + ` .env.php ` + ` .env.nginx ` + ` .env.mariadb ` + ` .env.traefik ` + the
5353 compose-orchestration ` .env ` . See [ README § Configuration files] ( README.md#configuration-files ) .
@@ -63,7 +63,7 @@ The full breaking-change list is in [CHANGELOG.md](CHANGELOG.md) under
6363### Pre-upgrade checklist (while still on 1.x)
6464
6565Everything in this section runs on the ** 1.x** checkout, with the stack ** still up** . The
66- configuration export (` task upgrade_prep ` ) reads the running application and fetches the live
66+ configuration export (` task env_migrate ` ) reads the running application and fetches the live
6767admin/client ` config.json ` — it cannot run once the stack is stopped. Confirm prerequisites
6868first:
6969
@@ -84,29 +84,30 @@ Then, on the 1.x stack:
8484- [ ] ** Be on the final 1.x release running 2.8 API images.** The export command ships with
8585 ` os2display-api-service ` 2.8.0. Set ` COMPOSE_VERSION_API=2.8.0 ` (or a later 2.x) in
8686 ` .env.docker.local ` and ` task install ` to pull and recreate. The last 1.x release of this repo
87- (v1.2.0) provides ` task upgrade_check ` / ` task upgrade_prep ` ; upgrade to it first if you are on
87+ (v1.2.0) provides ` task upgrade_check ` / ` task env_migrate ` ; upgrade to it first if you are on
8888 an earlier 1.x.
8989- [ ] ** Run the pre-flight check:** ` task upgrade_check ` . It confirms the api image provides
9090 ` app:utils:convert-env-to-3x ` and prints the bundled MariaDB volume name
9191 (` <COMPOSE_PROJECT_NAME>_mariadb ` ). ** Record that volume name** — the 3.x stack reuses it in
9292 place, and only does so when the 3.x ` .env ` keeps the same ` COMPOSE_PROJECT_NAME ` . A different
9393 project name silently boots an * empty* database (see step 4).
9494- [ ] ** Back up the database:** ` task backup_db ` (1.x), and keep the dump somewhere off-host.
95- - [ ] ** Export the configuration in 3.x shape:** ` task upgrade_prep ` . It writes ` env.3x ` — the
96- loaded env converted to 3.x names * plus* the admin/client ` config.json ` conversion. The
97- trailing advisory block lists infrastructure variables (` COMPOSE_* ` , ` PHP_* ` , ` NGINX_* ` ,
98- ` MARIADB_* ` ) that move to per-service files in 3.x, never into the application env.
95+ - [ ] ** Export the configuration in 3.x shape:** ` task env_migrate ` (1.x). It writes
96+ ` .env.symfony.migrated ` — the loaded env converted to 3.x names * plus* the admin/client
97+ ` config.json ` conversion. A trailing advisory block lists infrastructure variables
98+ (` COMPOSE_* ` , ` PHP_* ` , ` NGINX_* ` , ` MARIADB_* ` ) that move to per-service files in 3.x, never
99+ into the application env.
99100- [ ] ** Copy env files + JWT keys aside** in case a rollback is needed:
100101
101102 ``` bash
102103 mkdir -p /tmp/os2display-1x-backup
103- cp .env .env.docker.local .env.local env.3x /tmp/os2display-1x-backup/ # whatever subset you have
104+ cp .env .env.docker.local .env.local . env.symfony.migrated /tmp/os2display-1x-backup/ # whatever subset you have
104105 cp -r jwt/ /tmp/os2display-1x-backup/
105106 ```
106107
107- ` env.3x ` contains every application secret (` APP_SECRET ` , database and OIDC credentials, ...). It
108- is gitignored on both branches; treat it like a credentials file and it will survive the branch
109- switch in step 2 untouched.
108+ ` . env.symfony.migrated ` contains every application secret (` APP_SECRET ` , database and OIDC
109+ credentials, ...). It is gitignored on both branches; treat it like a credentials file and it
110+ will survive the branch switch in step 2 untouched.
110111
111112You do ** not** need to copy ` ./media/ ` aside for the rollback. It's a host bind-mount, not a
112113docker named volume — ` task purge ` , ` task down --volumes ` , and ` docker compose down --volumes `
@@ -169,15 +170,15 @@ per-service `env_file:` directives:
169170| ` .env.mariadb ` | MariaDB credentials. |
170171| ` .env.traefik ` | Traefik dashboard auth, Let's Encrypt email, cert provider. |
171172
172- Build ` .env.symfony ` from the ` env.3x ` you exported in the pre-upgrade checklist, then bootstrap
173- the rest:
173+ Build ` .env.symfony ` from the ` . env.symfony.migrated ` you exported in the pre-upgrade checklist
174+ (it survives the branch switch — gitignored on both branches), then bootstrap the rest:
174175
175176``` bash
176- # 1. Application config from env.3x. task env:migrate detects env.3x, splits off the
177- # infrastructure advisory (into .env.symfony.infra-advisory) and writes the rest to
178- # .env.symfony.migrated for review .
177+ # 1. Application config. task env:migrate finds the . env.symfony.migrated produced by 'task
178+ # env_migrate' on 1.x and splits its trailing infrastructure advisory into
179+ # .env.symfony.infra-advisory, leaving the clean application env in .env.symfony.migrated .
179180task env:migrate
180- diff -u env.3x . env.symfony.migrated # sanity check
181+ $EDITOR . env.symfony.migrated # sanity check
181182mv .env.symfony.migrated .env.symfony
182183
183184# 2. Per-service files + .env. task env:init creates .env (prompts for the domain) and the
@@ -194,8 +195,8 @@ $EDITOR .env
194195# 4. Finish .env.symfony.
195196$EDITOR .env.symfony
196197# - Set DATABASE_URL serverVersion to "11.4.10-MariaDB" (post-MariaDB upgrade — see step 4).
197- # env.3x carries the old 10.x serverVersion through verbatim; this is the one value env:migrate
198- # leaves for you.
198+ # The converter carries the old 10.x serverVersion through verbatim; this is the one value
199+ # env:migrate leaves for you.
199200# - Distribute the keys from .env.symfony.infra-advisory: COMPOSE_* -> .env, PHP_* -> .env.php,
200201# NGINX_* -> .env.nginx, MARIADB_* -> .env.mariadb.
201202
@@ -215,17 +216,17 @@ task env:diff
215216```
216217
217218<details >
218- <summary >Manual fallback (no `env.3x ` — pre-2.8 images, or stack already stopped)</summary >
219+ <summary >Manual fallback (no `. env.symfony.migrated ` — pre-2.8 images, or stack already stopped)</summary >
219220
220- If you never produced ` env.3x ` (the 1.x install predates the converter, or the stack is already
221- down), ` task env:migrate ` falls back to a sed conversion of ` .env.docker.local ` : it strips the
222- ` APP_ ` prefix from every key except the framework-defined trio (` APP_ENV ` / ` APP_SECRET ` /
223- ` APP_DEBUG ` ) and writes ` .env.symfony.migrated ` . This path ** cannot** see the admin/client
224- ` config.json ` , so you also convert those by hand and apply the per-site renames the converter
225- would have done:
221+ If you never produced ` . env.symfony.migrated ` (the 1.x install predates the converter, or the
222+ stack was already down), ` task env:migrate ` falls back to a sed conversion of ` .env.docker.local ` :
223+ it strips the ` APP_ ` prefix from every key except the framework-defined trio (` APP_ENV ` /
224+ ` APP_SECRET ` / ` APP_DEBUG ` ) and writes ` .env.symfony.migrated ` . This path ** cannot** see the
225+ admin/client ` config.json ` , so you also convert those by hand and apply the per-site renames the
226+ converter would have done:
226227
227228``` bash
228- task env:migrate # sed path when env.3x is absent
229+ task env:migrate # sed path when . env.symfony.migrated is absent
229230diff -u .env.docker.local .env.symfony.migrated
230231$EDITOR .env.symfony.migrated
231232```
0 commit comments