Integrated Application Platform › Forums › General › Restoring a library table › Reply To: Restoring a library table
No backups 🙁
There should be a suneido.bak if you have compacted or loaded the database.
Before you try anything else, make a copy of the database and put it somewhere safe.
As long as you haven’t compacted (or dump/load), the old data is still in the database file, but there is no easy way to get it.
The history doesn’t work if a table has been destroyed and recreated (as load does).
If you just need a few records you can open a copy of the database with a text editor that can handle large files. (e.g. Scite) Then search for either the name of the record or something in it. If the record has been updated there will be multiple versions in the file. The last one will be the most recent. Then just copy the text. (There will be a lot of unreadable binary data in the file as well, but the text itself should be readable.)
Another possibility is to force Suneido to rebuild the database as of just before you loaded the file. To do this you either need to truncate or corrupt the file at the right point. Again, you want to do this on a copy of the database that you don’t mind losing. The trick is to know what the right point is. If you look at the database in an editor you may be able to see where the load of the new library started. Past that, it may be a matter of trial and error. Corrupting is easy, just overwrite/delete/insert random characters. This will make the checksums fail.
NOTE: If you are using a text editor to truncate/corrupt the database file, make sure the editor isn’t altering anything else, e.g. not changing line endings or altering the binary data. Scite is usually ok.
Once you’ve corrupted/truncated the database file, run suneido -rebuild. It should tell you what date/time it is restoring to. If it doesn’t go back far enough, then truncate/corrupt earlier in the file. If it goes back too far, then take a fresh copy and truncate/corrupt later in the file.
I can’t guarantee this last method will be successful.
Sorry there isn’t an easier answer.