I still have a pieceinfo.db with over 500MB, so I checked what’s using so much space. It’s mostly filled with stefan-benten pieces…
When I try to delete these rows I’m getting “no such table: main.certificate”. Apparently there’s an invalid foreign key (not just for the stefan-benten sat, but for all).
So… is pieceinfo.db still being used, and if so, how can I clean it up?
Thanks, however the database itself is not malformed; if I just re-create it, it’ll be empty and all records of all sats are gone (including the productive ones).
Maybe someone with an older node can check if he also still has pieces of decomissioned sats in pieceinfo.db? And if so - is it possible to delete those rows?
It’s possible to delete this data, it is just not simple.
Make a backup copy of the database
Take a database schema sqlite3 pieceinfo.db ".schema"
Create a temporary copy of this table, but without FK
Insert there only valid data
Drop the source table
Create it back and insert all data from a temporary table
Drop the temporary table
However, in my case this table is empty, because this info was migrated to the pieces itself several years ago, the same for orders.db, because they are migrated to the orders folder near the config.yaml file.
So, I believe it would be simpler just recreate the database in question.
Wouldn’t it be more simple to just delete all the unwanted dbs and reclaim the space. My orders.db is 411MB. If there is any future use by devs then it can be recreated than relying on SNOs.
No. There are migrations. There are several not used databases, but we cannot easily drop them because of migrations and some links in the code.
Seems your node somehow missed some migrations or there was problems during applying.