-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multi: add migrate-db command #21
base: main
Are you sure you want to change the base?
Conversation
Using this code I was getting an error: So I added a quick patch: getAlby@0ffcae3 And then I was able to do the migration. The last logs were:
It seems everything has migrated succesfully, so I would say that a log line indicating this would also be useful. |
Hello, what happened with this PR? Have been it abandoned? I think this is very useful to migrate an existing bbolt to postgres and following this guide Thanks! |
This is an important PR we need to focus on to allow nodes to finally migrate from kv to native sql. cc @saubyk |
The top-level bucket structure might also have changed somewhat, so we should update that aspect. One other thing is we'll need to figure out a way to ensure that all the data has truly been migrated (eg: we don't forget some other top level bucket recently added). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still testing, but wanted to note some comments
|
||
### Using postgres as the destination remote database | ||
|
||
Prepare a user and database as described in the [Postgres](postgres.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't the link be: https://github.com/lightningnetwork/lnd/blob/master/docs/postgres.md?
data migration (e.g. disable any `systemd` or other scripts that start/stop | ||
`lnd`). | ||
|
||
NOTE: If you were using the experimental `etcd` cluster mode that was introduced |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a WARNING/CAUTION instead of NOTE
``` | ||
|
||
If you weren't running a watchtower server, you can remove the line with | ||
`--source.bolt.tower-dir`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should end with a section advising user to run the migrated node with the updated db config settings
so you mean having the db files constant here (channeldb, towerdb etc) is not enough but we need to also make sure every new bucket is in the new db ? Hmm not sure I understand this one? Because as long as we iterate through each bucket in the db file, there shouldn't be a problem that we miss a bucket ? |
7e593a9
to
b940a48
Compare
b940a48
to
427fd98
Compare
427fd98
to
67088f2
Compare
Migration now supports sqlite as well. Keep in mind this is still an experimental feature because we need to implement some consistency checks. This PR still needs some work:
Example for the sqlite migration:
make sure the data-dir for the sqlite directory is the same as the boltdb otherwise you need to copy the new files into the other directory when starting lnd. for postgress:
make sure you create a db in postgres before otherwise the opening of the db will fail. Also make sure you choose the correct network, otherwise the bolt.db will not be found in the LND dir. |
67088f2
to
b763270
Compare
This is work in progress and NOT recommended to be used with production/mainnet data!