sqlite legacy descriptor wallet migration fails #33468

issue jb55 openend this issue on September 23, 2025
  1. jb55 commented at 6:43 pm on September 23, 2025: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    the latest version of bitcoin does not load my legacy descriptor wallet, and migration doesn’t work

    when I try to migrate:

    0./build/bin/bitcoin-cli migratewallet personal
    

    I get:

    0error code: -4
    1error message:
    2Error: This wallet is already a descriptor wallet
    

    so effectively I can’t use my wallet in the latest version of bitcoin.

    cc @achow101

    Expected behaviour

    I expect migratewallet to migrate my legacy descriptor wallet to sqlite so I can use it

    Steps to reproduce

    Create a legacy descriptor wallet, and try to migrate it to sqlite

    Relevant log output

    0error code: -4
    1error message:
    2Error: This wallet is already a descriptor wallet
    

    When I try to load wallet:

    0./build/bin/bitcoin-cli -datadir=/Volumes/chunkstr/bitcoin loadwallet personal
    1error code: -18
    2error message:
    3Wallet file verification failed. Failed to open database path '/Volumes/chunkstr/bitcoin/personal'. The wallet appears to be a Legacy wallet, please use the wallet migration tool (migratewallet RPC or the GUI option).
    

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master@89144eb473c6bdb64f21de66912e915225ea6510

    Operating system and version

    MacOS 26.0

    Machine specifications

    M2 Max, external exFAT m.2 2TB drive in usb-c enclosure

  2. fanquake added the label Wallet on Sep 23, 2025
  3. jb55 commented at 7:19 pm on September 23, 2025: contributor

    commenting out that check didn’t seem to harm anything and it migrated successfully.

     0diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
     1index 6b5d08b0a3ad..150d79749324 100644
     2--- a/src/wallet/wallet.cpp
     3+++ b/src/wallet/wallet.cpp
     4@@ -4230,9 +4230,9 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(std::shared_ptr<CWallet>
     5     const std::string wallet_name = local_wallet->GetName();
     6 
     7     // Before anything else, check if there is something to migrate.
     8-    if (local_wallet->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
     9-        return util::Error{_("Error: This wallet is already a descriptor wallet")};
    10-    }
    11+    //if (local_wallet->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
    12+    //    return util::Error{_("Error: This wallet is already a descriptor wallet")};
    13+    //}
    14 
    15     // Make a backup of the DB in the wallet's directory with a unique filename
    16     // using the wallet name and current timestamp. The backup filename is based
    

    perhaps we just need a new check? since there could be legacy descriptor wallets?

  4. achow101 commented at 7:53 pm on September 23, 2025: member

    Can you be more specific as to which configuration you had? Was it bdb-descriptor or sqlite-legacy?

    Either way, both of those are not supported wallet configurations and are not possible to create without modifying the software.

  5. jb55 commented at 8:03 pm on September 23, 2025: contributor

    bdb-descriptor. I don’t think I ran modified software, I do remember importing descriptors exported via hwi a long time ago.

    if I remember correctly I used createwallet with descriptors=true and perhaps with sqlite not compiled ? so maybe thats what happened… hmm

  6. jb55 commented at 8:06 pm on September 23, 2025: contributor
    anyway I fixed it, all good
  7. jb55 closed this on Sep 23, 2025

  8. achow101 commented at 8:13 pm on September 23, 2025: member

    It was only possible to create bdb-descriptor with a build of master for the 5 months between #16528 and #19077. I’m surprised that migratewallet works on those wallets when removing that check.

    My typical recommendation for such wallets is to use bitcoin-wallet dump and bitcoin-wallet createfromdump to export the records and the load them into a new sqlite database.

  9. jb55 commented at 8:19 pm on September 23, 2025: contributor
    ok I will try that instead just in case


jb55 achow101

Labels
Wallet


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-09-26 15:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me