A Compose file describes a stack, but it isn't a backup of that stack. On a new VPS, the first failure may be a missing host file, an empty database volume, a build context that never made it onto the server, or an application starting before its dependency is ready.
Before allocating the destination, turn the configuration into a short migration checklist.
1. Inspect the actual Compose model
Docker Compose's config command combines the Compose files, resolves variables and expands shorthand. Use its normalized JSON output rather than trying to infer everything from the original YAML. It does not start your containers.
We released @motsell/compose-check, a small MIT-licensed CLI that reads that JSON locally. It requires a supported Node.js LTS (22+), has no runtime dependencies, and doesn't start Docker or contact a server.
Install the pinned npm package:
npm install -g @motsell/compose-check@0.1.0
docker compose config --format json | motsell-compose-check --json
Use this only with configurations you are authorized to inspect. The Compose command can resolve sensitive environment values: pipe its output directly instead of putting normalized JSON in a ticket or repository.
2. A synthetic example, actual output
Here is the report from the package's included example JSON: PostgreSQL with a named volume, an application with a local build context and a startup dependency, and a reverse proxy that mounts a configuration file. No containers were started and no data were moved.
Services: 3. Possible databases/caches: 1. Published-port entries: 1.
[review] service #1 DATA_RESTORE_REVIEW: Verify the data directory matches the persistent mount; rehearse recovery separately.
[review] service #2 BUILD_CONTEXT_REVIEW: Verify that the build context is available and builds on the destination architecture.
[review] service #2 DEPENDENCY_REVIEW: Review declared startup dependencies and required service readiness on restore.
[review] service #3 BIND_MOUNT_REVIEW: Transfer required host files/directories and verify permissions on the destination.
These are manual-review cues, not a security or migration guarantee.
Exit code 0 means there were no important findings under these limited rules, not that your stack is ready to switch. Exit 1 signals important review cues; exit 2 means invalid arguments or input.
Update, November 25: compare the volume names before you move
We normalized the same Compose starter in two directories, original-workspace and new-workspace, using Docker Compose v2.33.1-desktop.1. The YAML mount still read pgdata:/var/lib/postgresql/data, but Compose resolved it to original-workspace_pgdata in one directory and new-workspace_pgdata in the other.
Comparing the normalized configurations flagged three changed volume names and two changed network names. Using --project-name migration-drill in both directories removed all five name differences. The build context and the Caddyfile bind mount still changed: those paths need checking too. Reproduction and exact fixture.
The 0.2.0 CLI release can now compare two normalized JSON files. The npm registry still serves 0.1.0, so install the comparison release directly from GitHub:
npm install -g https://github.com/motsell/compose-check/releases/download/v0.2.0/motsell-compose-check-0.2.0.tgz
motsell-compose-check --file source.json --compare destination.json
Keep these exports private; normalized Compose output can contain secrets. You can also use the browser comparison without sending the files to MOTSELL.
This was a configuration-only test. No containers or database were started, and no data were restored. Matching names do not prove matching data.
For a local VS Code desktop window, there is now a manual editor preview. Select the two normalized JSON files from the Command Palette and read the report in the Output panel. The extension does not start Docker, send files to a server or print their contents. We tested this exact VSIX on VS Code 1.148.0 for macOS ARM64; other editor versions and operating systems remain untested.
3. Before switching traffic
The checklist is deliberately manual: verify a restorable application-consistent backup, inventory the host files and external resources, check the target architecture, then test dependency readiness and application behavior in a separate environment. depends_on alone is not a substitute for a meaningful readiness check.
The checker does not validate the full Compose specification, test network reachability, read referenced files, create backups, or prove restore success. Output uses ordinal service numbers and fixed codes instead of paths or secret values.
We maintain this tool at MOTSELL, a self-managed VPS provider. If you prefer a browser, use our local Compose checklist. For sizing and a starter stack, see our Docker Compose quick-start and VPS options.
About the author
- MOTSELL: self-managed Linux VPS in Germany and Finland for web apps, APIs and bots. We share reproducible deployment notes and state what was tested. Apps and backups remain the customer’s responsibility. Posts may use AI assistance. https://motsell.com/en/vps-vds?utm_source=hashnode&utm_medium=community&utm_campaign=profile_202611
Comments
Join the discussionThe opening line is the part that sticks: a Compose file describes a stack, but it is not a backup of that stack. Using the normalized JSON from docker compose config instead of reading the YAML by eye is a practical step, and the warning that depends_on alone is not a readiness check is worth repeating. An empty database volume on the new host is exactly the kind of failure that only shows up after traffic switches.
Exactly. A named volume is not proof that the application data is in the right place or recoverable. That is why the checker reports a review cue rather than a pass. The most useful step is restoring into an isolated environment and checking actual data before switching traffic. Thanks for pointing that out.