1

After 2 years of being shut down, I am trying to revive my bitcoin full node, while both switching platforms and upgrading to the current version in the process. Everything works but the wallet. The presence of the wallet causes the new node to crash (segfault). The node works when either wallet.dat is missing or when -disablewallet is provided. I do not really need that wallet to be fully imported, just to get the bitcoin associated with it into the an address controlled by the new node.

I read this issue report that blames the version of the berkley db lib files. I compiled bitcoin core locally with the older BDB libs provided via bitcoin/contrib/install_db4.sh per that issue report, and got the same result. The thing is, since (afaik) the windows platform does not provide an implementation of BDB, I have no idea what headers are correct for the wallet file generated by windows bitcoin core.

I want to avoid deleting and re-downloading the entire blockchain. I did run once with -disablewallet -assumevalid=0 to verify the entire blockchain. I retain backups of all pre-upgrade files, if it helps.

gdb backtrace pastebin. Note that this run was only a subset of the cli options I normally run with, specifically missing rpc info.

Old setup:

  • Windows 7 pro x64 sp1
  • bitcoin core gui (qt) 0.16.0
  • last synced early December 2018
  • BDB version unknown
  • datadir sat on slow external hdd (ntfs)

New node:

  • Debian Buster stable
  • bitcoin core daemon 0.21, compiled locally
  • syncing now, currently late March 2019
  • BDB 4.8.30.NC compiled via included script and detected by configure
  • datadir on slow internal sata hdd (ext4)

Is there any way to import an old/differently formatted wallet.dat file into a newer node? Is there perhaps a way to extract the private key info from said old file, so it can be manually imported? Could the old node software possibly create and send a transaction with the entire contents of the old wallet to a new address without fully syncing first? Is it possible the old version of bitcoinn core could fully sync with the modern blockchain?

e: forgot to mention: the db err logfile /mnt/data/blockchains/btc/blockchain/db.log is empty and retains the last modified date from the first startup of the original node in mid 2017.

e2: after translating the wallet to db version 4.8 as @PieterWuille suggested, the node reindexed and printed a number of lines like

2021-02-18T23:58:08Z [default wallet] Submitting wtx f7b5 to mempool for relay

but after running for a few days, it indexed up to block height just under 500000 and then segfaulted again.

7
  • What often works (but make sure you have a wallet.dat backup) in these cases is running "db<ver>_dump old_wallet.dat | db<ver>_load new_wallet.dat", where you replace the <ver> with the respective version number (e.g. db5.3_dump, db4.8_load). This'll create a new_wallet.dat file that's compatible with whatever version you select. Commented Feb 15, 2021 at 21:10
  • Was the old Bitcoin-Qt binary self compiled or a release binary? Release binaries always use BDB 4.8. Commented Feb 15, 2021 at 21:10
  • It doesn't look like this is related to BDB at all, actually, looking at the stacktrace. Can you try starting with -upgradewallet cmdline argument? (make a backup of wallet.dat first, of course). Commented Feb 15, 2021 at 21:21
  • @PieterWuille the old setup was the release build (80% sure). I will try upgradewallet next once my current attempt to importwallet via bitcoin-cli finishes, if it does not work. Does it matter that the old wallet.dat file is passphrase protected? At what point should I enter the passphrase (and how)?
    – memtha
    Commented Feb 15, 2021 at 22:01
  • You only need the passphrase to sign transactions (i.e, sending coins). You'll have to provide it using the walletpassphrase RPC (or if you use the GUI, it'll just ask you when needed). Commented Feb 15, 2021 at 22:07

1 Answer 1

1

I finally got this. Here is a brief summary for the future searcher:

  1. use the old software to launch the node with the old wallet.db file
  2. run the dump wallet command. This creates a file that is in a text format that is more portable than bdb.
  3. run load wallet command on the new node.
  4. rescan the new node (the default scan does not look very far back)

Note that the file created in step 2 is unencrypted and contains your private keys, so handle with care. Though I did wait for the new node to finish syncing, I doubt that is actually a requirement. I did not allow the old node to sync more than a few blocks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.