Chia db upgrade post execution steps

On Windows 10, I shut down Chia (version 1.3.3) and made a full copy of everything in the .chia directory (and sub-directories).

I ran:
chia db upgrade

No errors. But upon completion, it displayed a message that it is not touching the v1 database.
I was hoping to save space on my C: drive. But all of the old, original files are there, in addition to the new v2 files.

I have not yet started the GUI, because I have the following questions:

  1. Which files are safe to delete?
  2. Upon doing so, will Chia know to use the v2 database? If not, how do I tell Chia to use the new database? Do I need to edit the config.yaml file?
  3. I remember reading about address changes after the update.
    I farm solo. Do I need to check anything?

Good ? I tried deleting some V1 named files, started getting farmr warnings about missing addresses. Restored them, OK then. I’m not space constrained (yet) so just left it as it was. I just want it to work.

I was not space constrained yet either. I had approximately 325 GB free on my C: drive.
Chia was taking up 150 GB. So I figured I should do the DB upgrade while I still had 2x the space available of the current Chia usage.

I want to delete the old files. But I am not taking any risks. I want to be sure I delete only what is safe to delete.

I would appreciate if anyone can tell me which files to delete.
Also, how do I tell Chia to use the new v2 db?

My full node is down, awaiting help. I do not want to start it until I know the answers to my questions.

At a minimum, I would like to know how I point Chia to the new v2 db. If I could at least do that, then I could delete the unneeded, old db files down the road (since Chia will not be using them).

After you do the .\chia db upgrade it creates the V2 db files and changes the config.yaml file to point to the v2 in full node section. In the wallet section of config.yaml it still says V1, but I was told the code points to the V2 file. You can change it to say V2, this is to be changed in future release, at least that was said. If you installed from scratch it would say V2.

1 Like


Hope this helps and in the wallet folder

Here’s a list of files that are safe to delete: File Clean-up to get back more space - #2 by chiameh

  1. It will only know to use the v2 database if the config was updated to show blockchain_wallet_v2_CHALLENGE_KEY.sqlite from v1. Check that before starting.

  2. Probably not. Old target addresses should remain unchanged. Double check that they are your receiving addresses.

I noticed the “v1” reference in the config.yaml file, and the absence of any “v2” reference in the config.yaml file. So I was concerned about which db version Chia would use.

I need more assurance than an anonymous person said so.
I have seen some guessing being offered on occasion by well meaning people.

Then you also need to spend some more time on keybase in the support section, Get all the information that is available, they are the guys to ask straight on.

Because the upgrade from version 1 to 2 of the database is time-consuming, most users will likely only perform it on one of their systems and copy the new database file to their other systems afterward. If you choose this option, be sure to either copy the file before running chia start farmer -r, or stop Chia altogether if it is already using the new database. Once the database is swapped from v1 to v2, you also need to update you config.yaml to reflect the new v2 database change. Under the full_node: section set database_path: db/blockchain_v1_CHALLENGE.sqlite to database_path: db/blockchain_v2_CHALLENGE.sqlite

Running the db upgrade command on the node should upgrade the config for you, but if it does not, you will want to make sure to update it as described above.

2 Likes

Stupid me forgot to note what my receiving address was before I did the db upgrade.

Is the receiving address listed in any file?
I am asking because I have a copy of my entire .chia directory from before I did the db upgrade.
If the receiving address is listed in some file, then I can compare my updated file to my saved file. But I do not know which file.

I think it defaults to the first receiving address in your wallet. Since you backed up the entire .chia directory, look in the old config.yaml.

There are 2 instances of xch_target_address, for pool, and farmer. Make sure those are yours. If unsure, just make a new receiving address in your wallet and set it to that. Or better, use a cold wallet and set it to an address from that wallet.

Go look into the config.yaml for your xch_target_address:

1 Like

The “xch_target_address” is listed twice in the config.yaml file.
In both instances, they contain the same address.

Next, I compared my saved (before db upgrade) config.yaml xch_target_address value to my current (after db upgrade) config.yaml file’s xch_target_address value. They match.

So all seems to be in order.

I started my GUI, and all seems to be fine.
I checked which …\db files were being updated with new time-stamps, and none of my old files were updating (which is good).

The new db files were updating. Also good.

This goes for both db directories (main and for wallet).

2 Likes