Skip to content

migration: default to sqlite and surface flag defaults in -h#84

Open
0xfandom wants to merge 1 commit intolightninglabs:mainfrom
0xfandom:fix/75-migrate-db-defaults
Open

migration: default to sqlite and surface flag defaults in -h#84
0xfandom wants to merge 1 commit intolightninglabs:mainfrom
0xfandom:fix/75-migrate-db-defaults

Conversation

@0xfandom
Copy link
Copy Markdown

@0xfandom 0xfandom commented May 1, 2026

Summary

  • Switched --dest.backend default from postgres to sqlite so users on a fresh box without a postgres server can run lndinit migrate-db -n <network> without an extra flag. Matches LND's planned default backend.
  • Surfaced the --chunk-size default (20MB) and ceiling (500MB) in the flag description (the ceiling is enforced by migratekvdb.MaxChunkSize, the default by migratekvdb.DefaultChunkSize).
  • Refreshed the help block in docs/data-migration.md so the rendered (default: ...) for data-dir/tower-dir (already auto-populated by go-flags from the programmatic defaultDataDir) and the new --dest.backend / --chunk-size defaults are reflected in the docs.

Testing

  • make build clean.
  • go test -tags="kvdb_etcd kvdb_postgres kvdb_sqlite" ./... clean (the cmd_migrate_db_postgres_test.go suite explicitly sets Backend: lncfg.PostgresBackend, so the default flip does not affect coverage).
  • golangci-lint run --build-tags="kvdb_etcd kvdb_postgres kvdb_sqlite" --timeout 10m ./... clean.
  • Inspected lndinit-debug migrate-db -h output to confirm (default: sqlite), the chunk-size description, and the auto-populated data-dir / tower-dir defaults are all present.

Related

Closes #75

`migrate-db` previously defaulted `--dest.backend` to `postgres`, even
though LND is moving to sqlite as the default backend for new nodes.
Switch the destination default to sqlite so users without a postgres
server can run `lndinit migrate-db` without an extra flag.

Mention the `--chunk-size` default (20MB) and ceiling (500MB) in the
flag description so they show up in `-h`. Refresh the help block in
`docs/data-migration.md` to include the existing `data-dir` /
`tower-dir` defaults that go-flags already prints at runtime, and the
new `--dest.backend` and `--chunk-size` defaults.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant