Bitcoin Forum
April 19, 2024, 06:55:17 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Import Dumpfiles  (Read 228 times)
Engelen (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
January 31, 2020, 05:27:39 PM
 #1

I tried to import a dumpfile from a local bitcoin instance to another new local  "virgin" instance. Got an error message:

Command: 

importwallet "C:\DumpedWallets\UsersAdministratorDesktopWalletsDesktopDBitcoinBUwallet.dat"


Response:

Importing wallets is disabled when blocks are pruned (code -4)

I have tried several times  Do not understand

Running windows 10 and bitcoin core latest version




Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713509717
Hero Member
*
Offline Offline

Posts: 1713509717

View Profile Personal Message (Offline)

Ignore
1713509717
Reply with quote  #2

1713509717
Report to moderator
1713509717
Hero Member
*
Offline Offline

Posts: 1713509717

View Profile Personal Message (Offline)

Ignore
1713509717
Reply with quote  #2

1713509717
Report to moderator
1713509717
Hero Member
*
Offline Offline

Posts: 1713509717

View Profile Personal Message (Offline)

Ignore
1713509717
Reply with quote  #2

1713509717
Report to moderator
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
January 31, 2020, 07:00:05 PM
 #2

Afaik, when you prune the chainstate isn't stored so it will make it a lot harder to import a wallet, and I don't think you'll be able to do it without reindexing (and you might have to:
• disable pruning
• run reindex (probably done automatically with disabling pruning)
• import the wallets (preferably online)
• wait for the sync to happen (the days or weeks it takes) in order to store your new transactions for the wallet)
BitMaxz
Legendary
*
Offline Offline

Activity: 3234
Merit: 2941


Block halving is coming.


View Profile WWW
January 31, 2020, 07:16:53 PM
Last edit: January 31, 2020, 07:32:49 PM by BitMaxz
 #3

Are you trying to import the wallet file through RPC?

Can you try to delete the old wallet file(Note delete this if no bitcoins under this wallet) from your new wallet(Virgin instance) and then manually put the wallet file from old instance directly to %APPDATA%\Bitcoin of your new instance.

Don't forget to use the -rescan you can do this by going to Program Files>Bitcoin and open command prompt under that folder by holding shift key then right-click as shown as in this image below.



Then update here if it works or not.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
January 31, 2020, 07:32:17 PM
 #4

Are you trying to import the wallet file through RPC?

Can you try to deleteRENAME the old wallet file(Note delete this if no bitcoins under this wallet) from your new wallet(Virgin instance) and then manually put the wallet file from old instance directly to %APPDATA%\Bitcoin of your new instance.

Then update here if it works or not.

RENAME the old wallet file to wallet-bak.dat just so you don't make a mistake.
Heisenberg_Hunter
Legendary
*
Offline Offline

Activity: 1583
Merit: 1266


Heisenberg Design Services


View Profile WWW
January 31, 2020, 07:47:15 PM
 #5

You should understand the difference between a pruned wallet, pruned blockchain and a normal wallet. In a version of Bitcoin Core which runs pruned blockchain (which you use now), i.e a part of older blocks are deleted and the total size of the chain is reduced to match the stability of your computer. When the blocks become old, they are eventually deleted while you are running a pruned mode. So, whenever you import a wallet or addresses to Bitcoin Core, the -rescan rpc option is triggered by default. This will rescan the whole blockchain and will update your currently imported wallet balances.

Since the pruned mode doesn't have the whole blockchain, the rescan option has been disabled in pruned mode and since the Bitcoin Core cannot run -rescan option, the importing of wallet option is disabled in pruned mode. I guess, the default option for triggering the rescan should be false while importing wallets and addresses but this doesn't help you really.

Apart from being a full node, Bitcoin Core is a wallet as well. Rescan option is important for you to know about the current balances of the wallet and to prevent further double spending or transaction problems. So a newly imported addresses and wallet requires to run rescan option which can never be done with a pruned node.

See this code from bitcoin/src/wallet/rpcdump.cpp to know about this issue

Code:
if (pwallet->chain().havePruned()) {
        // Exit early and print an error.
        // If a block is pruned after this check, we will import the key(s),
        // but fail the rescan with a generic error.
        throw JSONRPCError(RPC_WALLET_ERROR, "Importing wallets is disabled when blocks are pruned");
    }

Don't forget to use the -rescan you can do this by going to Program Files>Bitcoin and open command prompt under that folder by holding shift key then right-click as shown as in this image below.
OP is running the wallet in pruned mode,I guess -rescan would never work as per the code.

P.S @Engelen what I have said is the basis for your error, if you would like to import the wallet follow @jackg's first post in this topic.
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
February 03, 2020, 07:31:56 PM
 #6

Is there a new "scam" and/or stolen wallet .zip file doing the rounds or something? Huh

I tried to import a dumpfile from a local bitcoin instance to another new local  "virgin" instance. Got an error message:

Command: 
importwallet "C:\DumpedWallets\UsersAdministratorDesktopWalletsDesktopDBitcoinBUwallet.dat"

Response:
Importing wallets is disabled when blocks are pruned (code -4)
Tried:

14:39:37
importwallet "C:\Users\Ingvar\Desktop\WalletsDesktop\DumpedWallets\UsersAdministratorDesktopWalletsDesktopDBitcoinBUwallet.dat"

Resonse:
Importing wallets is disabled when blocks are pruned (code -4)

Two different users... same wallet... same problem. Huh Huh Huh

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
AdolfinWolf
Legendary
*
Offline Offline

Activity: 1946
Merit: 1427


View Profile
February 03, 2020, 08:17:09 PM
Last edit: February 03, 2020, 08:54:35 PM by AdolfinWolf
 #7

Two different users... same wallet... same problem. Huh Huh Huh
I actually think it's the same person.

Their linguistics/formatting seem pretty similar. (And of course the path is a pretty decent hint too..?)
Tried:
14:39:37

importwallet "C:\Users\Ingvar\Desktop\WalletsDesktop\DumpedWallets\UsersAdministratorDesktopWalletsDesktopDBitcoinBUwallet.dat"

Res(p)onse:

Importing wallets is disabled when blocks are pruned (code -4)
I tried to import a dumpfile from a local bitcoin instance to another new local  "virgin" instance. Got an error message:

Command:  


importwallet "C:\DumpedWallets\UsersAdministratorDesktopWalletsDesktopDBitcoinBUwallet.dat"


Response:


Importing wallets is disabled when blocks are pruned (code -4)
Ever seen not one, but two people format like that?

ingvar_e
Jr. Member
*
Offline Offline

Activity: 32
Merit: 2


View Profile
February 17, 2020, 08:55:04 PM
 #8

It seems that I have 2 user ID: My error. Will keep this one.

Trying to use the information I got so far.

In this order:

Create a new "Virgin" bitcoin instance.

Disable Pruning

Run a full update.

Try a dumpwallet import.

Is this recommended procedure.?


I wonder  what the real purpose for creating a dumpfile is. It clears the wallet so what can you use a dumpfile  for (except import).
it would be nice to have a possibility to recreate a wallet.

Maybe someone has already created a useful tool that uses a dumpfile as input?  Except "importwallet"

HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
February 17, 2020, 09:25:42 PM
 #9

In this order:

Create a new "Virgin" bitcoin instance.
Disable Pruning
Run a full update.
Try a dumpwallet import.

Is this recommended procedure.?
I would not say it was "recommended"... obviously using a 'proper' wallet.dat backup file is the recommended way to restore a wallet. But yes, to "import" a dumpfile, then that would be the procedure to use, assuming you had a pruned instance, as pruning is disabled by default.


Quote
I wonder  what the real purpose for creating a dumpfile is. It clears the wallet so what can you use a dumpfile  for (except import).
A "dumpfile" does NOT clear the wallet. All it does is export your private keys in clear text. It does NOT remove private keys from your wallet dat, so your original wallet.dat file will remain unchanged.
Code:
dumpwallet "filename"

Dumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files.

The main purpose of these dumpfiles is generally if you need to bulk export private keys for some reason (moving to different wallet for instance)... for exporting specific single keys you can just use dumpprivkey:
Code:
dumpprivkey "address"

Reveals the private key corresponding to 'address'.
Then the importprivkey can be used with this output


Quote
it would be nice to have a possibility to recreate a wallet.
The 'normal' workflow for recreating wallets is to restore from a backup of the wallet.dat file itself... not using "dumpfiles".

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!