Author

Topic: [SOLVED] Is a newly migrated Wallet contain the same private key for re-funding (Read 154 times)

legendary
Activity: 2394
Merit: 5531
Self-proclaimed Genius
You can use
Code:
migratewallet
to migrate your legacy wallet (BDB) to HD wallet.
It's not what OP was asking though.
He already did that, thus raised his concern whether his old keys are still in the migrated wallet.
That was already answered "yes".

Also, it's not from "legacy to HD", it's from "legacy to descriptor", even HD legacy wallets can be migrated to a descriptor wallet.
Old non-HD wallets can be converted to HD with sethdseed command even if the user do not want it to be migrated to a descriptor wallet.
newbie
Activity: 2
Merit: 0
Yes, it is functional, but it is a complex solution that requires a deep understanding of the wallet. It is best suited for advanced users.

Thanks for your solution, I need to learn more.
sr. member
Activity: 192
Merit: 262
Smart World Global Token
If you have some private keys to import, my idea is to import them to a legacy wallet with a lower version Bitcoin Core Wallet, e.g. V24, then migrate the legacy wallet in V26.

You don't need to downgrade Bitcoin Core just to import a Private Key into a Legacy Wallet, because in Version 26.0 you can still create a Legacy Wallet with providing the -deprecatedrpc=create_bdb in bitcoin.conf and set descriptors=false when you create the legacy wallet.

You can also directly import, the Private Key from the Legacy Wallet into the Descriptor Wallet, but instead of using dumprivkey, you should use importdescriptors. In order to do that, You must have the form of the descriptor written properly (eg. pkh(PrivKey)#checksum). To get the checksum, use the getdescriptorinfo , then import the private key as a descriptor with the importdescriptors argument.
newbie
Activity: 2
Merit: 0
You can use
Code:
migratewallet
to migrate your legacy wallet (BDB) to HD wallet.

1. Bitcoin Core Wallet should NOT be in prune mode. Per my test, it will crash if the wallet is in a prune mode.
2. Open Bitcoin Core Wallet and import your data
3. run command
Code:
migratewallet {legacy_wallet_name} {the wallet's password}

Wait for a few minutes, it's done.

If you have some private keys to import, my idea is to import them to a legacy wallet with a lower version Bitcoin Core Wallet, e.g. V24, then migrate the legacy wallet in V26.


I read this Subject from OP digital_mine: https://bitcointalksearch.org/topic/issue-importing-wallet-from-private-key-on-bitcoin-core-version-25-5475186

And now I am running Bitcoin Core V26 with a wallet created on V22. Let's call it OutletWallet.
Everytime I open OutletWallet I get a warning message:
Code:
the legacy wallet type is being deprecated...migrate...
So, I proceeded with Migrate Wallet so that I can function with an uptodate Wallet on V26.

I still have my Paper Wallet with Public/Private key and QR code printed way back when I printed that sheet.

Will the new migrated OutletWallet still receive funds when I will utilize my QR code paper wallet to fund again ?

If I want a new paper document to backup my new OutletWallet, what informations should be printed so that I can retreive my funds in case of possible problems with computer or else ?  Is there a function in the Console that I can utilize to show such information ?
Thanks
staff
Activity: 3374
Merit: 6530
Just writing some code
Will the new migrated OutletWallet still receive funds when I will utilize my QR code paper wallet to fund again ?
Yes, migration will ensure that everything in the legacy wallet ends up in the migrate wallet. Nothing will be deleted.

In the event that there is an error which does delete things accidentally, a backup is automatically made and this backup is placed in the wallet directory. It will be named in the form -.legacy.bak This backup of your wallet can be restored with the wallet restoration functionality in Bitcoin Core, or it can be opened directly.

Code:
dumpwallet "yourwalletsname"

For a single private key, you can use this command below.

Code:
dumpprivkey "bc1sampleBTCaddress"
These RPCs as disabled for descriptor wallets, as well as all of the other dump and import commands, except for importdescriptors and listdescriptors.

How about the dumpprivkey? it works for me my current Bitcoin core version is v26.0.0 the dumpwallet also does not work for me except for dumpprivkey it should work to you unless your wallet is encrypted with passphrase you will need to use the command below to unlock it first before you dump the private key
The version of Bitcoin Core does not matter for whether these RPCs work. What matters is the type of wallet, which is stored as part of the wallet file itself.
hero member
Activity: 1120
Merit: 540
Press F for Leo
          ---  Following your instructions  ---
12 - Launched from Console: walletpassphrase "myPassPhrase" 60.  
Got "Error: running with an unencrypted wallet, but walletpassphrase was called. (code -15)"
Even though I did encrypt the wallet while on V26 !

So, the OutletWallet is not encrypted and dumpwallet still does not work.
An I can confirm that OutletWallet is a descriptor wallet for the "Menu/File/Migrate Wallet" is grayed/not available.

What I've I done wrong ?

Is it possible that while you are on Version 26, perhaps your wallet is a legacy wallet ?
In this case it could explain why you can dumpprivkey while I cannot.
You are entering the passphrase for another wallet selected in the console.

When opening the console, you will see a menu with the option: wallet, you must select the corresponding wallet to give the command you want, in this case, enter the passphrase for the corresponding wallet.
jr. member
Activity: 47
Merit: 18
How about the dumpprivkey?
.... unless your wallet is encrypted with passphrase you will need to use the command below to unlock it first before you dump the private key
Code:
walletpassphrase "my passphrase" 60
If this does not work maybe you did disable the private key during wallet creation? or this is a descriptor wallet?

This is so weird!
Here is how I proceeded.
1- I launched Bitcoin Core V22
2- Closed all wallets (there was only one)
3- Created a new blank wallet call OutletWallet
4- Launched from Console: importprivkey "Thelongkeywithnumbersandletters" "" false   -   Worked fine
5- Launched from Console: rescanblockchain             -     Was long but worked fine
           ---  At this point I am on V22 and I have a legacy wallet ---
6- Updated to V26 by simply copying all apps from the V26/bin folder
7- Launched Bitcoin Core V26    -    the OutletWallet loaded properly and showed proper amount of Sats.
8- Launched the Menu/File/Migrate Wallet     -    Worked fine
9- Launched the Menu/Settings/Encrypt Wallet. With a passphrase that I wrote down  -  Worked fine
           ---  At this point I am on V26 and I have an encrypted descriptor wallet because I Migrated it ---
10- Launched from Console: dumpprivkey. Got:  "Only legacy wallets are supported by this command (code -4)"
11- Launched from Console: dumpwallet "OutletWallet".   Got:  "Only legacy wallets are supported by this command (code -4)"

           ---  Following your instructions  ---
12 - Launched from Console: walletpassphrase "myPassPhrase" 60.  
Got "Error: running with an unencrypted wallet, but walletpassphrase was called. (code -15)"
Even though I did encrypt the wallet while on V26 !

So, the OutletWallet is not encrypted and dumpwallet still does not work.
An I can confirm that OutletWallet is a descriptor wallet for the "Menu/File/Migrate Wallet" is grayed/not available.

What I've I done wrong ?

Is it possible that while you are on Version 26, perhaps your wallet is a legacy wallet ?
In this case it could explain why you can dumpprivkey while I cannot.




legendary
Activity: 3234
Merit: 2943
Block halving is coming.

These two commands do not work on the newer wallet version.
Both commands are stricktly functional on a legacy wallet
as per the Console feedback error code -4

How about the dumpprivkey? it works for me my current Bitcoin core version is v26.0.0 the dumpwallet also does not work for me except for dumpprivkey it should work to you unless your wallet is encrypted with passphrase you will need to use the command below to unlock it first before you dump the private key

Code:
walletpassphrase "my passphrase" 60

If this does not work maybe you did disable the private key during wallet creation? or this is a descriptor wallet?

For the descriptor wallet, you can follow the guide from this link below on how to export private key it is a bit complicated compared to old ways to dump private keys.

- https://bitcointalksearch.org/topic/m.62109703
jr. member
Activity: 47
Merit: 18
I think to backup a wallet copying the wallet.dat file should be enough but if you want to backup the
private key or the master private key you can use dumpwallet command sample command below
Code:
dumpwallet "yourwalletsname"
For a single private key, you can use this command below.
Code:
dumpprivkey "bc1sampleBTCaddress"

These two commands do not work on the newer wallet version.
Both commands are stricktly functional on a legacy wallet
as per the Console feedback error code -4
legendary
Activity: 3234
Merit: 2943
Block halving is coming.
If the public address shown in your Bitcoin core wallet is the same as in your paper backup yes you should still receive the funds on the same wallet unless the address is changed after migration.

I hope next time before you upgrade your Bitcoin core to the most recent version always make a wallet.dat file backup just in case for future recovery.



I think to backup a wallet copying the wallet.dat file should be enough but if you want to backup the private key or the master private key you can use dumpwallet command sample command below

Code:
dumpwallet "yourwalletsname"

For a single private key, you can use this command below.

Code:
dumpprivkey "bc1sampleBTCaddress"

Without quotes.
jr. member
Activity: 47
Merit: 18
I read this Subject from OP digital_mine: https://bitcointalksearch.org/topic/issue-importing-wallet-from-private-key-on-bitcoin-core-version-25-5475186

And now I am running Bitcoin Core V26 with a wallet created on V22. Let's call it OutletWallet.
Everytime I open OutletWallet I get a warning message:
Code:
the legacy wallet type is being deprecated...migrate...
So, I proceeded with Migrate Wallet so that I can function with an uptodate Wallet on V26.

I still have my Paper Wallet with Public/Private key and QR code printed way back when I printed that sheet.

Will the new migrated OutletWallet still receive funds when I will utilize my QR code paper wallet to fund again ?

If I want a new paper document to backup my new OutletWallet, what informations should be printed so that I can retreive my funds in case of possible problems with computer or else ?  Is there a function in the Console that I can utilize to show such information ?
Thanks
Jump to: