What you’re on the lookout for is the restorewallet
RPC. As of two/2/2022, this has not been included in a launch of Bitcoin Core (though it’s within the grasp code department on GitHub). It is going to be included within the v23 launch, anticipated in April 2022.
restorewallet "wallet_name" "backup_file" ( load_on_startup )
Restore and masses a pockets from backup.
Arguments:
1. wallet_name (string, required) The title that can be utilized to the restored pockets
2. backup_file (string, required) The backup file that can be used to revive the pockets.
3. load_on_startup (boolean, elective) Save pockets title to persistent settings and cargo on startup. True so as to add pockets to startup checklist, false to take away, null to depart unchanged.
Consequence:
{ (json object)
"title" : "str", (string) The pockets title if restored efficiently.
"warning" : "str" (string) Warning message if pockets was not loaded cleanly.
}
Examples:
> bitcoin-cli restorewallet "testwallet" "homebackupsbackup-file.bak"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "methodology": "restorewallet", "params": ["testwallet" "homebackupsbackup-file.bak"]}' -H 'content-type: textual content/plain;' 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", "id": "curltest", "methodology": "restorewallet", "params": {"wallet_name":"testwallet","backup_file":"dwellingbackupsbackup-file.bak"","load_on_startup":true}}' -H 'content-type: textual content/plain;' http://127.0.0.1:8332/
The importwallet
RPC is utilized in a distinct state of affairs, to import an inventory of keys from a dumpfile (a plaintext checklist of keys generated by the dumpwallet
RPC).
To revive a backup with v22 and beneath, merely:
- navigate to your
wallets/
listing in your bitcoin information listing - create a brand new listing inside
wallets/
with a novel title of your selection for the restored pockets. - Copy the pockets file into this newly created listing, and rename it to
pockets.dat
- Begin bitcoin core, and it’s best to be capable of load the pockets.