Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: HistoryBloke on December 03, 2017, 11:16:20 PM



Title: Bitcoin Backup & Restore from Core?
Post by: HistoryBloke on December 03, 2017, 11:16:20 PM
Hi everyone!

So I run the Bitcoin Core full node software on my PC and keep my btc there.  My PC has a 512gb SSD (c:\) as my main drive and a 2TB backup hard drive (d:\), which is where my Bitcoin Core program stores everything.  The 2TB drive is about 4 years old and is almost full - I'm about to replace it with a 4tb hard drive and need to backup everything. 

What's the best way to achieve this?  I remember my pass phrase but I don't remember writing down any keys or words, or anything like that.  it's been years since I originally installed it. 


Title: Re: Bitcoin Backup & Restore from Core?
Post by: Welsh on December 03, 2017, 11:21:30 PM
You can go about this two ways; First you could simply copy the wallet.dat and put in in a safe place which you can later on transfer to your new hard drive, for example you USB. Secondly, you could note down on a piece of paper, or what ever and put them in a safe place. When it comes to restoring your wallet, you could create a new and import the private keys.

I would recommend just making a copy of the wallet.dat for the transfer, but still note down your private keys and keep them in a safe etc just in case one day you do forget your password for the client.


Title: Re: Bitcoin Backup & Restore from Core?
Post by: HistoryBloke on December 03, 2017, 11:40:35 PM
but still note down your private keys and keep them in a safe

How exactly?  I'm not sure how I would find them.


Title: Re: Bitcoin Backup & Restore from Core?
Post by: RGBKey on December 04, 2017, 12:21:52 AM
but still note down your private keys and keep them in a safe

How exactly?  I'm not sure how I would find them.
To do this in Bitcoin Core, you'd need to open the debug console, unlock your wallet with the walletpassphrase command, then use the dumpprivkey command on every address in your wallet that contains coins. This is a laborious process, and it's much easier to simply back up your wallet.dat file (hopefully you encrypted it with a password that you won't forget) which contains the deterministic key for your wallet, meaning if you back up that file, you won't need to replace it with a new version every time you receive coins.


Title: Re: Bitcoin Backup & Restore from Core?
Post by: HistoryBloke on December 04, 2017, 01:25:14 AM
but still note down your private keys and keep them in a safe

How exactly?  I'm not sure how I would find them.
To do this in Bitcoin Core, you'd need to open the debug console, unlock your wallet with the walletpassphrase command, then use the dumpprivkey command on every address in your wallet that contains coins. This is a laborious process, and it's much easier to simply back up your wallet.dat file (hopefully you encrypted it with a password that you won't forget) which contains the deterministic key for your wallet, meaning if you back up that file, you won't need to replace it with a new version every time you receive coins.

Perfect!  Thank you!  One more question...

So if I backup the wallet.dat tonight and disassemble my PC, but I receive some bitcoin in the next few weeks.  When I re-install my core client, restore the wallet, and re-sync to the network... will the newly sent BTC be there?  I guess what I'm asking is...

1. Does the wallet.dat file itself contain the bitcoin? or...
2. Does the blockchain technically contain my bitcoin and the wallet.dat file is simply the "key" to access the "safe-deposit box?"  I assume the core client will process the blockchain and then see that I'm supposed to have x amount of bitcoin, so it then "arrives?"


Title: Re: Bitcoin Backup & Restore from Core?
Post by: ranochigo on December 04, 2017, 01:58:25 AM
Perfect!  Thank you!  One more question...

So if I backup the wallet.dat tonight and disassemble my PC, but I receive some bitcoin in the next few weeks.  When I re-install my core client, restore the wallet, and re-sync to the network... will the newly sent BTC be there?  I guess what I'm asking is...
Yes. Does your client have a HD symbol on the lower right? If so, then it would definitely be good to just have it backedup once.

1. Does the wallet.dat file itself contain the bitcoin? or...
No.
2. Does the blockchain technically contain my bitcoin and the wallet.dat file is simply the "key" to access the "safe-deposit box?"  I assume the core client will process the blockchain and then see that I'm supposed to have x amount of bitcoin, so it then "arrives?"

Yeah kinda. The blockchain is a set of ledger that records the transactions. Your client will look through the blockchain for any transaction that is relevant to your address and display it to you.

You can only spend those unspent output with your private keys.


Title: Re: Bitcoin Backup & Restore from Core?
Post by: HistoryBloke on December 04, 2017, 02:02:06 AM

Yes. Does your client have a HD symbol on the lower right? If so, then it would definitely be good to just have it backedup once.


Well... it does have "HD" but it has a line through it.  I didn't think it had the line through it, though.


Title: Re: Bitcoin Backup & Restore from Core?
Post by: RGBKey on December 04, 2017, 02:43:58 AM

Yes. Does your client have a HD symbol on the lower right? If so, then it would definitely be good to just have it backedup once.


Well... it does have "HD" but it has a line through it.  I didn't think it had the line through it, though.
If it has a line through it, then it is NOT using HD, and it must have been created with an older version of the software. However, if you back it up then, it should still be alright. Just don't continue to send money to the backed-up wallet.