Author

Topic: You can have wallet.dat anywhere and with any name, now! (Read 5697 times)

staff
Activity: 4284
Merit: 8808
This is an inconsiderate bump of a very old thread.

Interesting and I gonna to try it out later today. This will make file management easier and it seems I won't need to manually change filenames by renaming anymore.   Wink

Bitcoin Core has had the ability to set the wallet file name with -wallet= for years. There is no need to rename files, and hasn't been a reason to do so for longer than your account here has existed.  You cannot change the path because if you split the BDB recovery logs and wallet file itself onto seperate media you will end up with irreparabile data corruption if there is an unclean power off with (un)reasonable probablity.

hero member
Activity: 518
Merit: 502

Reasons why not to do this are given in this issue: https://github.com/bitcoin/bitcoin/issues/68
The concerns regard corruption of the wallet due to improper locking.

Don't really understand what you mean with "married to LOG... file", though.
member
Activity: 63
Merit: 10
If you can compile bitcoind &/or bitcoin-qt, you can have a wallet with any name, on any drive, in any directory. The wallet is not restricted to the name wallet.dat, nor is it tethered to the [data] directory.

I had always thought that '-wallet' did that, but I guess not... Glad to hear it, and a damn good thing to protect against malicious code.

Renaming my wallet to 'KittyPicsToShareWithFriends.zip'.  
That'll teach 'em


Interesting and I gonna to try it out later today. This will make file management easier and it seems I won't need to manually change filenames by renaming anymore.   Wink
legendary
Activity: 1001
Merit: 1005
I tested this in a Testnet wallet, but without succes. Or will it only work on the mainnet?

Can you answer this question? Great feature but does it work on testnet? I would not test a new wallet on mainnet.
legendary
Activity: 1512
Merit: 1012
This is very useful! I hope it will eventually get merged with the main code. Thank you Smiley
full member
Activity: 210
Merit: 104
“Create Your Decentralized Life”
If you can compile bitcoind &/or bitcoin-qt, you can have a wallet with any name, on any drive, in any directory. The wallet is not restricted to the name wallet.dat, nor is it tethered to the [data] directory.

I had always thought that '-wallet' did that, but I guess not... Glad to hear it, and a damn good thing to protect against malicious code.

Renaming my wallet to 'KittyPicsToShareWithFriends.zip'.  
That'll teach 'em
hero member
Activity: 623
Merit: 501
Will you make pull request to bitcoin-core repository?
I would, if I could  Huh I'm a noob on github  Shocked
member
Activity: 108
Merit: 10
Will you make pull request to bitcoin-core repository?
hero member
Activity: 623
Merit: 501
I tested this in a Testnet wallet, but without succes. Or will it only work on the mainnet?
b!z
legendary
Activity: 1582
Merit: 1010
Cool! Now we can have backups with different names, which makes sorting easier too.
sr. member
Activity: 260
Merit: 251
Hello all,

I have been fighting GitHub and my ignorance, long and hard, but have finally won!

See
https://github.com/old-c-coder/bitcoin-git/commit/929019012dc7d93fd3ba59d8eb553e390211a713

If you can compile bitcoind &/or bitcoin-qt, you can have a wallet with any name, on any drive, in any directory. The wallet is not restricted to the name wallet.dat, nor is it tethered to the [data] directory.

Bitcoin-qt allows one to "backup" ones wallet to anywhere, with any name (not really! It doesn't allow names with no extension, at least on windows!). Now one can run from that back up wallet, or anywhere. The idea is that there is a new argument for bitcoin.conf or the command line, that names and locates what used to be wallet.dat only in the data directory.

For example, after exiting bitcoin, d or qt, one can copy ones wallet.dat to another location say drive x, path y and name z. One only has to add a line to bitcoin.conf, if you are using one, or an argument to the bitcoin program of -walletpath=x:/y/z, or in bitcoin.conf walletpath=x:/y/z

That's it. It can be a partial path, e.g. walletpath=y/z or a filename walletpath=z

If there is no walletpath argument, bitcoin behaves as before. Also if the argument is walletpath=wallet.dat it also behaves as before. This just makes explicit what was implicit before! This change then, if one doesn't use it doesn't 'disturb the force' Smiley

I have tested it successfully with all kinds of names, even with no extension, on various drives, in various directories. There is one proviso: the wallet file, whatever its name now, still has some "genetic" connection to a 1MB file called [data] directory/database/log.0000000001

I don't know their relationship, but I could probably move it with the wallet file if needed. This means that it would be prudent keep log.0000000001 in "sync" with one\'s wallet.

The advantage of separating the wallet from the now ~9.75GB block chain is that they can be on different drives or even computers!? Or one can have various, possibly test versions, of bitcoind or bitcoin-qt, and they can all share the same block chain, or can share the same wallet.

I have added the change to the 0.8.3 release source and it works there too.

All these changes have been on a windows unit, so I am curious about the other two platforms.

I haven't tried with coins in the wallet, but I see no problems:) Let me know if you like it, or have any questions.

Ron
Jump to: