4 hours ago
Ok. After another sleepless night I believe I managed to find a solution that works and lead to the malformed issue going away at least temporarily for me.
This will be a bit longer post, but ill explain it in a way that a complete beginner can do it, hope that's alright.
First off, this fix only rarely works if https://sqlite.org/recovery.html is to be trusted, so I cant say if this is a permanent fix or just temporarily or it will fix any/all malformed datadisk issues on jellyfin, it will also only be relevant if you use windows, I do not have any experience with any other OS's to help enough sorry.
1. If you do not have SQLITE get it from https://sqlite.org/download.html, find the Precompiled Binaries for Windows and go for the "A bundle of command-line tools for managing SQLite database files, I got this because I couldn't get it to work through CM/Powershell because I'm dense.
2. Unzip the the archive into whatever folder you want, I put it in a folder on the desktop
3. Safely backup the Library.db/Jellyfin.db -- (the corrupted ones yes)
4. Copy safely the Library.db/Jellyfin.db to the desktop folder -- can be found in your jellyfin folders.
5. open sqlite3.exe in the desktop folder, type ".open jellyfin.db" or "library.db" and run the command "pragma integrity_check;" -- when you have figured out which one or if both are giving errors do the following steps for each(don't overwrite existing files etc).
6. start sqlite3.exe again, type ".open library.db" -- (or jellyfin.db, if you're doing jellyfin.db just change the names to make it less messy)
7. write ".output library_recover.sql" and then ".recover" -- This will take a while and will result in a new file being created in the folder called library_recover.sql, you will know it has finished when a new empty line appears again.
8. Reopen sqlite3.exe, type ".open library_new.db" followed by ".read library_recover.sql" -- Your .open command created a new file in the folder called library_new.db and then .read essentially rebuilt the database based on the information from the .sql file, is the best way I can explain it.
9. write ".open library_new.db" and do point 4, if you are not getting any errors it might be fixed, now do this again for the jellyfin.db(if it was giving errors) otherwise shutdown your server and try adding this new db and see if it starts without any errors.
When you've done this for both files (if needed) dont forget to rename them correctly and make sure you are saving the right files etc.
This worked for me hope it will work for someone else or help, Cheers, Thanks to everyone in this thread helping out.
This will be a bit longer post, but ill explain it in a way that a complete beginner can do it, hope that's alright.
First off, this fix only rarely works if https://sqlite.org/recovery.html is to be trusted, so I cant say if this is a permanent fix or just temporarily or it will fix any/all malformed datadisk issues on jellyfin, it will also only be relevant if you use windows, I do not have any experience with any other OS's to help enough sorry.
1. If you do not have SQLITE get it from https://sqlite.org/download.html, find the Precompiled Binaries for Windows and go for the "A bundle of command-line tools for managing SQLite database files, I got this because I couldn't get it to work through CM/Powershell because I'm dense.
2. Unzip the the archive into whatever folder you want, I put it in a folder on the desktop
3. Safely backup the Library.db/Jellyfin.db -- (the corrupted ones yes)
4. Copy safely the Library.db/Jellyfin.db to the desktop folder -- can be found in your jellyfin folders.
5. open sqlite3.exe in the desktop folder, type ".open jellyfin.db" or "library.db" and run the command "pragma integrity_check;" -- when you have figured out which one or if both are giving errors do the following steps for each(don't overwrite existing files etc).
6. start sqlite3.exe again, type ".open library.db" -- (or jellyfin.db, if you're doing jellyfin.db just change the names to make it less messy)
7. write ".output library_recover.sql" and then ".recover" -- This will take a while and will result in a new file being created in the folder called library_recover.sql, you will know it has finished when a new empty line appears again.
8. Reopen sqlite3.exe, type ".open library_new.db" followed by ".read library_recover.sql" -- Your .open command created a new file in the folder called library_new.db and then .read essentially rebuilt the database based on the information from the .sql file, is the best way I can explain it.
9. write ".open library_new.db" and do point 4, if you are not getting any errors it might be fixed, now do this again for the jellyfin.db(if it was giving errors) otherwise shutdown your server and try adding this new db and see if it starts without any errors.
When you've done this for both files (if needed) dont forget to rename them correctly and make sure you are saving the right files etc.
This worked for me hope it will work for someone else or help, Cheers, Thanks to everyone in this thread helping out.
