What you might be searching for is the restorewallet
RPC. As of two/2/2022, this has no longer been integrated in a liberate of Bitcoin Core (even if it’s within the grasp code department on GitHub). It’ll be integrated within the v23 liberate, anticipated in April 2022.
restorewallet "wallet_name" "backup_file" ( load_on_startup )
Repair and rather a lot a pockets from backup.
Arguments:
1. wallet_name (string, required) The title that will likely be carried out to the restored pockets
2. backup_file (string, required) The backup dossier that will likely be used to revive the pockets.
3. load_on_startup (boolean, not obligatory) Save pockets title to power settings and cargo on startup. True so as to add pockets to startup checklist, false to take away, null to go away unchanged.
Outcome:
{ (json object)
"title" : "str", (string) The pockets title if restored effectively.
"caution" : "str" (string) Caution message if pockets was once no longer loaded cleanly.
}
Examples:
> bitcoin-cli restorewallet "testwallet" "homebackupsbackup-file.bak"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "identity": "curltest", "manner": "restorewallet", "params": ["testwallet" "homebackupsbackup-file.bak"]}' -H 'content-type: textual content/undeniable;' http://127.0.0.1:8332/
> bitcoin-cli -named restorewallet wallet_name=testwallet backup_file="homebackupsbackup-file.bak"" load_on_startup=true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "identity": "curltest", "manner": "restorewallet", "params": {"wallet_name":"testwallet","backup_file":"housebackupsbackup-file.bak"","load_on_startup":true}}' -H 'content-type: textual content/undeniable;' http://127.0.0.1:8332/
The importwallet
RPC is utilized in a distinct situation, to import an inventory of keys from a dumpfile (a plaintext checklist of keys generated by means of the dumpwallet
RPC).
To revive a backup with v22 and beneath, merely:
- navigate for your
wallets/
listing to your bitcoin information listing - create a brand new listing within
wallets/
with a novel title of your selection for the restored pockets. - Replica the pockets dossier into this newly created listing, and rename it to
pockets.dat
- Get started bitcoin core, and also you will have to be capable of load the pockets.