Skip to content

migrate-db: make defaults that match LND and document all defaults when running with -h #75

@ZZiigguurraatt

Description

@ZZiigguurraatt

Right now lndinit migrate-db has --dest.backend default to postgres:

--dest.backend=[postgres|sqlite] The destination database backend. (default: postgres)

. This seems weird to me since we plan to make SQLite the default in future versions of LND. If we expect most users to use SQLite with LND, we should make it the default to encourage everyone to use that and not confuse them with the more complicated postgres option that only advanced users will use. Right now, if the user does not have a postgres server and they don't pass --dest.backend=sqlite, they get an error

2026-01-27 23:16:29.707 [INF]: LNDINIT Opening postgres backend at `` with prefix `channeldb`
2026-01-27 23:16:29.707 [ERR]: LNDINIT Runtime error: failed to open destination db with prefix `channeldb`: failed to connect to `host=/tmp user=zziigg database=`: dial error (dial unix /tmp/.s.PGSQL.5432: connect: no such file or directory)

Also, we have --source.bolt.data-dir and --dest.sqlite.data-dir. These have no defaults defined in the docs at:

.

I think they should match the default of LND, which is ~/.lnd/data so that most users don't need to pass any arguments to lndinit migrate-db. When testing, it seems they actually do, so we should document it.

We also have --chunk-size. This has no default defined in the CLI docs:

--chunk-size= Chunk size for the migration in bytes

.

It is defined in data-migration.md at

The migration is resumable and happens in chunks of default 20MB to make it

but all users aren't going to know that from running

lndinit migrate-db -h

and could waste time trying to figure it out. Therefor, we should properly document that a default is actually defined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions