Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: bitrebel on August 13, 2011, 02:43:30 AM



Title: Is it necessary to close bitcoin client before making a backup of wallet file?
Post by: bitrebel on August 13, 2011, 02:43:30 AM
I think I read somewhere that you have to close the bitcoin client before making a wallet file backup. Is this correct?  ???



Title: Re: Is it necessary to close bitcoin client before making a backup of wallet file?
Post by: Maged on August 13, 2011, 02:49:31 AM
It's a good idea. If closing Bitcoin is inconvenient, you should use the backupwallet RPC command. If you don't close Bitcoin and just copy the file, it's not guaranteed that the backup won't be corrupted.


Title: Re: Is it necessary to close bitcoin client before making a backup of wallet file?
Post by: jackjack on August 13, 2011, 02:50:37 AM
I don't think it's critical but as the client locks the wallet database, it's better to close it
Better safe than sorry


Title: Re: Is it necessary to close bitcoin client before making a backup of wallet file?
Post by: randomguy7 on August 13, 2011, 02:52:13 AM
Good question. I wouldn't trust a wallet backup made while the client was running. I think the file could be in an inconsistent state if it was copied while the client was writing to it.
The next question is if the client can automatically fix such a wallet.dat and if only the new changes are lost or if it breaks the whole wallet.


Title: Re: Is it necessary to close bitcoin client before making a backup of wallet file?
Post by: kjj on August 19, 2011, 12:15:22 AM
If you use the backupwallet command, the client closes the wallet, flushes the write caches, makes a copy, and reopens it, so that you don't need to stop the client.