Saturday 3 March 2018

Importing your address into a new wallet-qt.

For whatever reason, there are times you need to import your address into another wallet. 

This post will go through three steps, your situation may not match these steps so please pick and choose your information as necessary.

1. exporting your private key

2. creating a new empty wallet

3. importing your private key

These steps will be addressed very simply and will require some prior knowledge, please see this post which includes much more information about similar material
https://bumbacoin.blogspot.com.au/2015/10/cleaning-up-your-wallet-qt-when-it.html

                                                                                     
1. get your address, dump private key

I will assume you already know your address,  this post will use the address B8QX8peKA9LvDb4Ya5GaMWwwLQoukV2aRY
so now you go into the debug/console
please enter command (using your address
> dumpprivkey B8QX8peKA9LvDb4Ya5GaMWwwLQoukV2aRY

you will need to copy the output somewhere safe, you will need this to import into a new wallet.
the private key in this case is
Pe69Ten35qDWqc5cHbGEZfG5bq9npRtY8WkjXAvfGGaJiUQMFo63


now close your wallet-qt

                                                                                     
2. enter your datadirectory, the bumbacoin datadirectory on my computer looks like this


you will notice i have a highlighted file, wallet.datBAK and a wallet.dat, in this case wallet.datBAK is a prior backup i have made, and wallet.dat is the file that currently holds my address,
i now need to delete or rename the file wallet.dat
then when the wallet-qt starts it will generate a new empty wallet.dat file.

                                                                                     
3. open the wallet-qt, it will now create an empty wallet,
once again open the debug/console, this time you will import the private key from step 1.
at this point you can give the address an optional name, 

> importprivkey Pe69Ten35qDWqc5cHbGEZfG5bq9npRtY8WkjXAvfGGaJiUQMFo63 newaddress

this will take some time as it scans the database for transactions. please wait.



you have now imported the key, congratulations ;)

----

it is possible that the wallet did not pick up all transactions and you are missing some, you can repeate the process as many times as you like and it should work.

alternatively, if you have 1000's of transactions, it may be better to start up with -rescan
or re-sync the entire chain and let it pick up each transaction.
that is a different post though