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 will likely be included within the v23 launch, anticipated in April 2022.
restorewallet "wallet_name" "backup_file" ( load_on_startup )
Restore and hundreds a pockets from backup.
Arguments:
1. wallet_name (string, required) The title that shall be utilized to the restored pockets
2. backup_file (string, required) The backup file that shall 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 listing, 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", "technique": "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", "technique": "restorewallet", "params": {"wallet_name":"testwallet","backup_file":"housebackupsbackup-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 situation, to import a listing of keys from a dumpfile (a plaintext listing of keys generated by the dumpwallet RPC).
To revive a backup with v22 and under, merely:
- navigate to your
wallets/listing in your bitcoin knowledge listing - create a brand new listing inside
wallets/with a singular title of your alternative 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 to load the pockets.
