Bitcoin Forum
May 24, 2024, 11:43:33 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: "backupwallet(importwallet)" command VS "copy" command  (Read 284 times)
tsubasa1380 (OP)
Newbie
*
Offline Offline

Activity: 15
Merit: 4


View Profile
November 27, 2018, 06:02:20 PM
Merited by ABCbits (1), bones261 (1)
 #1

Q: What is a difference between bitcoin-core "backupwallet(importwallet)" command and unix "copy" command ?

I'm planning to move "wallet.dat" to new server bought a few days ago.

I looked over books how to move "wallet.dat" and understood as below.

--「Mastering Bicoin」 Andreas M. Antonopoulos----
Commands: backupwallet, importwallet, dumpwallet
Next, we will practice creating a wallet backup file and then restoring the wallet from
the backup file. Use the backupwallet command to back up, providing the filename as
the parameter. Here we back up the wallet to the file wallet.backup:

  $ bitcoin-cli backupwallet wallet.backup
  $
Now, to restore the backup file, use the importwallet command. If your wallet is locked,
you will need to unlock it first (see walletpassphrase in the preceding section) in order
to import the backup file:

  $ bitcoin-cli importwallet wallet.backup
  $
---------------------------------------------------------------

I have a question.

Why not use unix "copy" command and then overwrite "wallet.dat" ?

Is there anything wrong with this approach ?
Forsyth Jones
Hero Member
*****
Offline Offline

Activity: 1176
Merit: 634


Press F for Leo


View Profile WWW
November 27, 2018, 07:00:30 PM
Merited by bones261 (1)
 #2

Q: What is a difference between bitcoin-core "backupwallet(importwallet)" command and unix "copy" command ?
None.

you don't need to use the command line to back up the wallet. Just run the Bitcoin Core software and go to "File" will appear several options, among them, click the "backup wallet" option, then a window will appear for you to select the directory you would like to save your backup file, name the file to: bitcoin wallet backup or something like that and that's it.

You can do this same backup from the command line using the commands: "backupwallet" or "dumpwallet."

The "dumpwallet" option will dump all private keys in your wallet into a file that you specify during the execution of the command. Ex: dumpwallet "Desktop/bitcoin-keys-backup.key you should encrypt this file later because it is fully readable. That is why command line options are only recommended for users who have a certain experience with Bitcoin, do not use the Bitcoin Core command line unless you know what you are doing...

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
tsubasa1380 (OP)
Newbie
*
Offline Offline

Activity: 15
Merit: 4


View Profile
November 27, 2018, 07:34:30 PM
 #3

Why not use unix "copy" command and then overwrite "wallet.dat" ?

Because not everyone uses Linux/Unix terminal and the guide mention how to backup wallet from bitcoin-cli

Is there anything wrong with this approach ?

AFAIK no, perhaps only permission to copy file with copy/cp command
Thank you for the quick response !

I am happy to hear your experience.

I have one more question about  backup "wallet.dat".

I am running a full node bitcoin server.
And I hope to backup "wallet.dat" every day by using cron which kicks shell scripts.
In this shell script, using "backupwallet" command is better than "copy" command ?
There are hundreds of both singlesig addresses and multisig address in this "wallet.dat".
Is it true that  using wallet.dat command takes much time than using copy command ?

Which do you recommend for backup ?
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4186
Merit: 8424



View Profile WWW
November 27, 2018, 08:27:54 PM
Merited by ABCbits (1), aliashraf (1)
 #4

You cannot back up the wallet by copying without shutting down the software first.  The backupwallet rpc lets you back up while running.
tsubasa1380 (OP)
Newbie
*
Offline Offline

Activity: 15
Merit: 4


View Profile
November 28, 2018, 02:05:26 AM
 #5

You cannot back up the wallet by copying without shutting down the software first.  The backupwallet rpc lets you back up while running.

I understood as follows.
In case with copy command,
If the file(wallet.dat)  is being written, it will cause problems.
Is this okay?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!