Skip to content

SQLite to Postgres Docker migration fails: migrate-db.ts not found in container #2453

@JeffResc

Description

@JeffResc

Summary

The Docker-based SQLite to PostgreSQL migration command from the documentation fails because the migration script (src/cli/migrate-db.ts) doesn't exist in the built Docker image.

Steps to Reproduce

Following the docs, after extracting the SQLite database and setting up PostgreSQL:

docker run --rm -it \
  -v $(pwd)/meshmonitor.db:/data/meshmonitor.db:rw \
  --network host \
  ghcr.io/yeraze/meshmonitor:latest \
  npm run migrate-db -- \
    --from sqlite:/data/meshmonitor.db \
    --to postgresql://meshmonitor:xxx@localhost:5432/meshmonitor

Error

> meshmonitor@3.10.1 migrate-db
> tsx src/cli/migrate-db.ts --from sqlite:/data/meshmonitor.db --to postgresql://meshmonitor:***@localhost:5432/meshmonitor

node:internal/modules/run_main:107
    triggerUncaughtException(
    ^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/app/src/cli/migrate-db.ts' imported from /app/
    at finalizeResolution (node:internal/modules/esm/resolve:275:11)
    at moduleResolve (node:internal/modules/esm/resolve:865:10)
    at defaultResolve (node:internal/modules/esm/resolve:991:11)
    at nextResolve (node:internal/modules/esm/hooks:785:28)
    at resolveBase (file:///app/node_modules/tsx/dist/esm/index.mjs?1774558712056:2:3744)
    at resolveDirectory (file:///app/node_modules/tsx/dist/esm/index.mjs?1774558712056:2:4243)
    at resolveTsPaths (file:///app/node_modules/tsx/dist/esm/index.mjs?1774558712056:2:4984)
    at resolve (file:///app/node_modules/tsx/dist/esm/index.mjs?1774558712056:2:5361)
    at nextResolve (node:internal/modules/esm/hooks:785:28)
    at AsyncLoaderHooksOnLoaderHookWorker.resolve (node:internal/modules/esm/hooks:269:30) {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///app/src/cli/migrate-db.ts'
}
Node.js v24.14.0

Analysis

The npm run migrate-db script references tsx src/cli/migrate-db.ts, but the Docker image only contains compiled output (likely under dist/), not the TypeScript source files. The migration script needs to either be included in the image or the npm script should point to the compiled JS output instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions