Rebuilding a damaged RSK file
When an RSK file appears to be corrupt, and the original download was "raw", use the following method to rebuild a new RSK. This method will not work with EasyParse (Mobile) files since they do not contain the deployment/channels headers as part of the downloads.
If the file is not readable by Ruskin: "database disk image is malformed", recover it by simply extracting the download data directly into a new bin file.
Steps
-
Copy broken RSK file to local hard disk.
-
Run the command line binary extraction on the broken RSK:
sqlite3 somefile.rsk "SELECT quote(data) FROM downloads" | cut -d "'" -f2 | xxd -r -p >> somefile.bin
-
Open the binary file in Ruskin.
-
After the binary processes, close the resulting new RSK.
-
Validate that the new RSK opens in Ruskin.
-
Rename new RSK file appropriately if needed.
For files with Header 0 if the data table has a corrupt page, use the SQLBrowser. (Otherwise, there will have to be manual creation of missing data such as channels or schedule.)
Steps
-
Open the corrupt RSK in SQLBrowser.
-
Export all but the data table to a SQL text file.
-
Import the SQL text file into a new RSK.
-
Open the new RSK in Ruskin.
-
Upgrade the RSK in Ruskin.
-
Close Ruskin if hung (the Thumbnail is repopulated with all the data).
-
Re-open the RSK in SQLBrowser and removed all but the first entry from the thumbnail table.
-
Re-open the RSK in Ruskin.
If these steps do not work, you can try to validate the file:
sqlite3 somefile.rsk "PRAGMA integrity_check;"
You could also try to remove the errors by vacuuming the db:
sqlite3 somefile.rsk "VACUUM;"
The next step would be to attach to the db via the cli and attempt to dump it to a new file:
sqlite3 somefile.rsk
.mode insert
.output dump.sql
.dump
.exit
The result of this is an ascii SQL file that can be viewed and edited with standard tools like vi.