Upgrade to v1.3.1 with database v2 created a new v2 wallet database

I thought that the upgrade process to the v2 database only affected the main blockchain database, blockchain_v2_mainnet_111111.sqlite. Why did it create a new wallet database, blockchain_wallet_v2_mainnet_111111.sqlite, alongside the v1 wallet database.

It appears that the v1 wallet database is no longer being updated, but config.json still points to the v1 wallet database. How does this work? What interaction is happening? Is this a bug?

Seems like a bug. I had previously looked at the source code for db_upgrade_func command in another thread and thought that might be the case. I am a software developer but am not very familiar with the Chia source code.

It doesn’t look like the wallet is included in the DB upgrade. The config is only referring to the “full_node” database path which is the block DB. It doesn’t seem like the wallet is updated, but someone else did mention also seeing the new wallet database file with only the v1 wallet in use and in config.

1 Like

Do you recall where you saw that? Can you think the thread or post? Curious to follow developments with that, because the issue wasn’t fixed in the v1.3.1 patch release.

1 Like

After pulling teeth, I got them to agree that after the .\chia db upgrade you can change the wallet/db/blockchain_wallet_v2_CHALLENGE_KEY.sqlite

Yeah sorry for not including that at first. Here’s the thread! Chia 1.3 Windows Upgrade from 1.2.11

I don’t understand. Can you explain this another way?

Is this just the new light wallet? 1.3 uses the light wallet and syncs much quicker. Unless you have been dusting.

I think it does only work on the blockchain. It looks like wallet db is upgraded independently from the blockchain, the minute you update to v1.3.1 (not sure about v1.3, as I skipped that one), regardless whether you are still on blockchain v1 or v2…

I have just run software update to v1.3.1 from v1.2.11. I did it on a test box. That node was about month behind (Feb 22). Upon installation, it started syncing blockchain db (still v1). However, as you have noticed, it right away abandoned v1 wallet db, and proceeded to create v2 version of it. It derived the path (I moved my dbs) from config.yaml wallet db path; however, used a default name (so it is hardcoded for whatever reason, but chia code is ridden with hardcoded values). Perhaps, you have noticed, that the new db shrunk by order of 3 magnitudes (from 10GB down to 12MB). Think how much garbage was stored in v1. This is perhaps the biggest improvement in v1.3.x, at least from my perspective. So, I would not call it a bug, but rather a proactive, and long overdue improvement.

Actually, UI has one more change on Wallet page. There is a Connections section at the bottom. When my wallet was fully synced, based on those connection stats, all the wallet data came from those other peers, even though my full node was working. Also, wallet connects to other full nodes, not wallets, so I really don’t understand why it is not pulling local data. Although, as it was syncing from those other peers, it fully synced within few minutes, where my blockchain height is still around 100k behind (so you don’t need to even have local blockchain, in order to sync the wallet - as it was before).

It does look light, doesn’t it? Although, it looks like this is a full wallet.

I was told in “Keybase” that the wallet is coded to use the V2 database even though it says v1. Was said it was for downgrade ability. I changed mine to v2. I won’t downgrade.

That argument sounds like a joke, doesn’t it.

Is it mentioned somewhere in the release notes?

I mean, I do believe that switching to v2 wallet was a right decision, but ignoring config.yaml is just bad code.

This is what was said over in Keybase by emlowe

1 Like

Yeah, I had few bad exchanges with that guy before on github.

So, following his logic, once you run blockchain upgrade, you don’t have anymore “seamless downgrade” to v1.2.11, as it does modify config.yaml. Really?

The config.yaml is there for a purpose, and it is to have the user decide what should be used and how. Hardcoding stuff is bad, trying to say that it is for your benefit is just ridiculous. For instance, if you make a mistake / typo in the wallet db path, if it can, it will create a new folder somewhere, or it will just barf (spinner), if it cannot create one. It should really follow the settings from config.yaml, and eventually let the user know what is potentially wrong with those settings.

Also, that v1/v2 part, at least with v1.3.11 looks like is just a part of the friendly name. You can put vXYZ there, and as long as db will respond with v2 version, it will use it. However, when you rename your v1 db to have v2 mark, it doesn’t check db anymore for version, but rather barfs with a spinner.

Kind od a pretzel logic, but in some limited situation, for sure enables “seamless downgrade.”

I guess, part of I wrote above is not right. Trying to make another few runs, I don’t think that the code checks with db what version it is. Also, it looks like it checks for v1 mark, and if present, starts a new wallet db (even though I renamed my v2 to be v1). However, when I either omitted that v mark, or put it at 2 or higher, it used that db. I guess, if the v1 check is being made, the v-non-2 check should also be made, as we don’t know what v3 will be.

Hi peeps.
It’s OK to run the upgrade while farming on my main node ?

I backed it up less than 24 hrs ago incase of a fail.

Before I upgraded I copied both the .chia and the .chia_keys folders to make sure (CYA). Then I reboot my machine, installed 1.3.3 let it sync then shut down the GUI then ran the .\chia db upgrade but that’s me some have said they upgraded while it was running. The less you have running the quicker it goes, only took less that 35 minutes here.


Ta, as others have done it I’ll try.
I saw a vid saying it was fine, but many minds are better than one.

Cheers, enjoy ur day.

I did it the same way as @drhicom . Just make sure that with every step you will give it some time ty sync or settle down. Also for me, after the final start, the wallet was claiming to be fully synced, but was missing few XCH. It got back to normal after another 10 long minutes. Just don’t rush it, as it still have process scheduling problems, and potentially wallet db corruptions.

Actually, one more thing. Before you do the final start, just check your config.yaml, as wallet db location is most likely not updated to v2 (at least it was not on v1.3.1).


Windows updates tried to restart on me , only on phase 4 of 5, glad I caught that in time to stop it.

No worries, as long as you have a copy of that v1 db, you can just run that upgrade again.

One way to deal with those updates is to wait for about a week or so after you install the last ones, and block them for a month. This way, you will see your primary computer being nagged to be updated, while you have no pressure on your farming side for another week.

I get messages of space in telegram every time they’re due, I knew it was today.

Q I’m not sure can be answered but worth a shot.

I tapped the cursor on the window while it was upgrading.

That cmd window is now not changing.

I could assume it’s like mm and still running just paused screen.

Is this likely or should I restart the conversion?


Nevermind, he’s moving again.