Thank you for the contribution.
Unfortunately in my case the script did not help.
Here is an output:
> Do you acknowledge and accept the disclaimer? (yes/no): yes
> Enter the directory containing the SQLite database files: /home/sk/StorjTEST/BAD
> Enter the directory where you want to save backups: BAK
> Enter the directory where you want to save the fixed databases: GOOD
> Checking integrity of /home/sk/StorjTEST/BAD/bandwidth.db...
> The database /home/sk/StorjTEST/BAD/bandwidth.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/garbage_collection_filewalker_progress.db...
> The database /home/sk/StorjTEST/BAD/garbage_collection_filewalker_progress.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/heldamount.db...
> The database /home/sk/StorjTEST/BAD/heldamount.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/info.db...
> The database /home/sk/StorjTEST/BAD/info.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/notifications.db...
> The database /home/sk/StorjTEST/BAD/notifications.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/orders.db...
> The database /home/sk/StorjTEST/BAD/orders.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/piece_expiration.db...
> Integrity check failed for /home/sk/StorjTEST/BAD/piece_expiration.db. Attempting to fix...
> Backing up the original database...
> Exporting the database to SQL...
> Creating a new database from the SQL dump...
> Cleaning up...
> Checking integrity of the fixed database...
> The fixed database GOOD/piece_expiration.db passed the integrity check.
> Do you want to replace the original database with the fixed database? (yes/no): no
> Kept the fixed database in GOOD/piece_expiration.db.
> Checking integrity of /home/sk/StorjTEST/BAD/pieceinfo.db...
> The database /home/sk/StorjTEST/BAD/pieceinfo.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/piece_spaced_used.db...
> The database /home/sk/StorjTEST/BAD/piece_spaced_used.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/pricing.db...
> The database /home/sk/StorjTEST/BAD/pricing.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/reputation.db...
> The database /home/sk/StorjTEST/BAD/reputation.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/satellites.db...
> The database /home/sk/StorjTEST/BAD/satellites.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/secret.db...
> The database /home/sk/StorjTEST/BAD/secret.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/storage_usage.db...
> The database /home/sk/StorjTEST/BAD/storage_usage.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/used_serial.db...
> The database /home/sk/StorjTEST/BAD/used_serial.db is not malformed.
> Checking integrity of /home/sk/StorjTEST/BAD/used_space_per_prefix.db...
> The database /home/sk/StorjTEST/BAD/used_space_per_prefix.db is not malformed.
> All databases have been processed.
However, the file piece_expiration.db turned out to be zero length
I could attach the corrupted database file if you are interested in debugging the script.
No, I was upset by the failure and simply deleted all the databases.
But I still have a backup, I’ll try to do a manual fix for fun.
Is it possible to replace a new database file (created from scratch) with a fixed database later?