@@ -308,6 +308,48 @@ variable](https://symfony.com/doc/current/components/phpunit_bridge.html#configu
308308docker compose exec --env SYMFONY_DEPRECATIONS_HELPER=disabled phpfpm composer tests
309309```
310310
311+ ## Preparing an upgrade to 3.x
312+
313+ The ` app:utils:convert-env-to-3x ` command converts the configuration of this
314+ (2.x) installation to 3.x environment configuration. The values _ loaded_ in
315+ the running application are treated as canonical — whether they come from
316+ real environment variables, a docker compose ` environment ` block or
317+ ` .env ` /` .env.local ` files — and every variable the application reads is
318+ written out under its 3.x name.
319+
320+ Unless ` --skip-config-json ` is given, the command also fetches the canonical
321+ admin and client configuration from ` <app-url>/admin/config.json ` and
322+ ` <app-url>/client/config.json ` and converts them to the 3.x ` ADMIN_* ` and
323+ ` CLIENT_* ` variables. The base URL is inferred from the loaded OIDC redirect
324+ URIs (or ` COMPOSE_DOMAIN ` ) and can be overridden with ` --app-url ` .
325+
326+ ``` shell
327+ # Review on screen (default):
328+ docker compose exec phpfpm bin/console app:utils:convert-env-to-3x
329+
330+ # Write a dotenv file ON THE HOST, the starting point for the 3.x .env.local.
331+ # With --output=env (and --output=compose) the document goes to stdout and all
332+ # notes/warnings go to stderr, so the result can be redirected from outside
333+ # the container (-T: no TTY, keeps stdout byte-clean):
334+ docker compose exec -T phpfpm bin/console app:utils:convert-env-to-3x \
335+ --output=env --app-url=https://display.example.com > env.3x
336+
337+ # Or a docker compose environment block:
338+ docker compose exec -T phpfpm bin/console app:utils:convert-env-to-3x --output=compose > env.3x.yml
339+ ```
340+
341+ Note that ` --file ` writes inside the container, so it only makes sense for
342+ paths on a mounted volume; prefer the host-side redirect above in dockerised
343+ setups.
344+
345+ Loaded variables the Symfony application cannot read (` COMPOSE_* ` , ` PHP_* ` ,
346+ ` NGINX_* ` , ` MARIADB_* ` /` MYSQL_* ` ) are listed in a trailing advisory with a
347+ note on where each belongs in a 3.x deployment: compose orchestration values
348+ go in the docker host ` .env ` , and the container-tuning values go on the
349+ respective containers (` .env.php ` , ` .env.nginx ` , ` .env.mariadb ` in the
350+ ` os2display-docker-server ` file layout). They are never part of the
351+ application env output.
352+
311353## CI
312354
313355Github Actions are used to run the test suite and code style checks on all PRs.
0 commit comments