I am switching from bitcoin-qt to Electrum, and it seems as if I will need to download the blockchain again. Can I copy and paste my wallet.dat into Electrum's files?
According to this FAQ:
In Electrum 2.0, you cannot import private keys in a wallet that has a seed. You should sweep them instead.
If you want to import private keys and not sweep them you need to create a special wallet that does not have a seed. For this, create a new wallet, select “restore”, and instead of typing your seed, type a list of private keys, or a list of addresses if you want to create a watching-only wallet.
You can get the private keys from Bitcoin Core using
dumpprivkey as described in Using dumpprivkey to make a paper backup.
Start Bitcoin Core with the
wallet.datyou want to export
Dump all wallet keys via Bitcoin Core's Console using
dumpwallet wallet.dump, where
wallet.dumpis the name of the dump file to be created.
If you get an error, try specifying an absolute file path with a dir to which Bitcoin Core has the permission to write to, e.g. you can specify the same dir as the one where your
wallet.dat is located.
- You'll get a list of private key to address pairs in the following format:
L4ysibEFMBQc3hfr7tvUyV4nBP1YQ3AgDewszoYq5czMtXotmmro 2020-08-21T14:36:58Z change=1 #addr=bc1qpw40dkvcj23zt3efvdwqr7ddfunwktx11f3tjf
- Extract all the private keys (they are in the first column, e.g.
I remove unnecessary stuff at the beginning and at the end of the dump file manually, then use
cut -c 52- wallet.dump > private_keys.dump to leave out everything except of the private keys.
- Create a new Electrum wallet, select "Import Bitcoin addresses or private keys", convert your keys according to the rules available by clicking on "Info" button (you may not need to convert them if your
wallet.datis quite old) and you're good to go!
The above is tested on Bitcoin Core 0.21.1.0 and Electrum 4.1.5.
If you export the private keys for the addresses you want to keep then you are literally your own bank, most wallets allow you to import private keys in some way. I don't know the specifics of doing it on Electrum though.
To export from bitcoin-qt go into the debug console from the menus, and enter
Keep that key safe - it is the key to all coins in that address now, past & future. Don't leave it on your desktop or dropbox, preferably carefully copy and paste it into the other wallet without writing to disk.
I have to disagree with the other 2 answers at the time of this writing. While indeed wallet.dat contains all the critical information, and in theory you could just use it with another application, in practice the wallet file format is not consistent between applications, and AFAIK you cannot use that file elsewhere.
Your best course of action depends on your needs, but it's probably to export your private keys, import them elsewhere (such as blockchain.info), and send the coins to the wallet you want to use going forward.
What do you mean "import them elsewhere (such as blockchain.info)"?– GeremiaFeb 14, 2015 at 21:57
1@Geremia: After you've exported your private key, you can import it to another wallet. Once the key is imported, you can spend the coins it controls using this wallet. Every wallet has its own interface for importing. An example for a wallet to which you can import the key is blockchain.info. Feb 15, 2015 at 12:08
This question is already answered in the Electrum tutorials http://electrum.org/tutorials.html#switching-to-electrum
What to do with my old addresses and wallet when switching to Electrum?
The best way to switch to Electrum is to send all the bitcoins you have on your old wallet to one of the addresses on your Electrum wallet. This way you'll have all your bitcoins secured with your seed.
You could import the private keys from your old client, but you will have to keep a backup of those keys separately as they won't become part of your Electrum seed.
Remember not to totally delete your wallet.dat if you gave your addresses for the deposite to other people