forex.pm forex forum binary options trade

 Сryptocurrency exchanges => Binance - Сryptocurrency exchanges => Topic started by: Bitcoin on Feb 03, 2022, 04:07 am

Title: What is the proper way to import a wallet from a file after removing it completely
Post by: Bitcoin on Feb 03, 2022, 04:07 am
What is the proper way to import a wallet from a file after removing it completely

Just wanted to ask a question about "importwallet" bitcoin-cli command.


After starting my bitcoind daemon, created a wallet, protected with a passphrase and made a backup to a file:


bitcoin-cli createwallet wallet1
bitcoin-cli encryptwallet mypassword
bitcoin-cli backupwallet ~/wallet1.backup

I want to test if I am able to recover my backuped wallet. This is what I am testing:


bitcoin-cli stop
rm -Rf ~./bitcoin/wallets/wallet1

And then start again my bitcoind server. At this point I want to import my wallet. I try this:


$ bitcoin-cli importwallet ~/wallet1.backup
error code: -18
error message:
No wallet is loaded. Load a wallet using loadwallet or create a new one with  createwallet. (Note: A default wallet is no longer automatically created)

But as you can see, the bitcoin-cli is requesting to create a new wallet. Just to import an existing one? I don't understand that point.


For this particular example, what should be the proper way to import the wallet? Tnks!


Source: What is the proper way to import a wallet from a file after removing it completely (https://bitcoin.stackexchange.com/questions/112176/what-is-the-proper-way-to-import-a-wallet-from-a-file-after-removing-it-complete)