# Moving a Docker Compose project to a new VPS? Check what won’t move with the YAML

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](https://www.npmjs.com/package/@motsell/compose-check):

```bash
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.

```text
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](https://github.com/motsell/motsell/blob/775d47cc600090454fe851023a94c78f0ace8026/notes/compose-project-name.md).

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:

```bash
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](https://motsell.com/tools/motsell-compose-check-en.html?utm_source=hashnode&utm_medium=referral&utm_campaign=compose_check_20261119&utm_content=project_name_compare) 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](https://github.com/motsell/compose-check/releases/tag/editor-v0.1.0). 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.

[Source and example fixture](https://github.com/motsell/compose-check).

We maintain this tool at MOTSELL, a self-managed VPS provider. If you prefer a browser, use our [local Compose checklist](https://motsell.com/tools/motsell-compose-check.html?utm_source=hashnode&utm_medium=referral&utm_campaign=compose_check_20261119&utm_content=browser_tool). For sizing and a starter stack, see our [Docker Compose quick-start and VPS options](https://motsell.com/en/vps-docker?utm_source=hashnode&utm_medium=referral&utm_campaign=compose_check_20261119&utm_content=migration_preflight#docker-quick-start).
