Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

Restoring a library table

Integrated Application Platform › Forums › General › Restoring a library table

  • This topic has 6 replies, 2 voices, and was last updated 6 years, 7 months ago by amckinlay.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • July 5, 2016 at 10:52 am #1265
    ajith
    Participant

    Hi All,

    Using the command prompt I loaded an earlier version of a library (from a dumped su file without changing the name) I was working on. Unfortunately I don’t have a copy of the most recent version of the library that was in the database which got over-written. Is there a way to recover the library table that was overwritten / restore the database to the time before the load?
    I tried history which shows only the newly uploaded file and Windows File History is not turned on. My windows version is 10 and I was using Suneido Jan 6 2016 version of cSuneido.
    Thanks,
    ajith

    July 5, 2016 at 11:21 am #1266
    amckinlay
    Keymaster

    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.

    July 5, 2016 at 11:41 am #1267
    ajith
    Participant

    Hi Andrew,

    Thanks for the quick reply. I knew it was not going to be easy. Happy to hear that there are some possibilities. I will check them and get back.
    I did keep a copy as soon as I recognized the blunder I did.

    Thanks,
    ajith

    July 5, 2016 at 12:17 pm #1268
    ajith
    Participant

    Hi,
    I tried with Notepad++ and with Scite. However, I am getting the error: “..\mmfile.cpp:61:ERROR:assert failed: (file_size% MM_ALIGN)==0” when I try to corrupt the database. I did try many different combinations of inserting / deleting /altering characteristics each time on a fresh copy of the backed up db file. But, I keep on getting the above error. I am assuming that I am not breaking the file at the right spot and that I should try again. However, because the error is the same, I just want to make sure that I am not missing anything.
    Thanks,
    ajith

    July 5, 2016 at 12:29 pm #1269
    amckinlay
    Keymaster

    Sorry, I forgot about that check. The file size must be a multiple of 8. If you delete or insert make sure it’s a multiple of 8 characters. Probably simpler just to overwrite some characters. (Pressing the INS key should switch you to overwrite mode.)

    July 5, 2016 at 12:31 pm #1270
    ajith
    Participant

    Hi,

    I did it! I removed one character at a time and after removing 8 characters, Suneido asked for rebuild. Thanks a lot. You saved a lot of my work.

    Given the trouble I caused myself, may I ask if it will be a lot of work to implement the option of rebuilding up to a user given time?

    Thanks a lot,
    ajith

    July 5, 2016 at 12:37 pm #1271
    amckinlay
    Keymaster

    Glad you got your work back 🙂

    I have thought about allowing rebuild as of a given date/time. It probably would not be that hard.

    I am reluctant because I think it would encourage people to depend on it, which I do not think is a good idea. Rebuild was intended for crash recovery, not for normal usage. It could be useful though.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Log In

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • Alpha copy of gSuneido to play with
  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo

Contact Us | Legal Statement | Privacy Statement | SiteMap

Copyright © 2023 Axon® Development Corporation. All Rights Reserved. - Open Source Integrated Database and Programming Language