Base can I revert back to HSQLDB

After having lots of issues with Firebird I went back to using HSQLDB. Working on new table in existing database I was getting the migration message and selecting ‘later’.
However I think I must have managed to click ‘yes’ in error… (had multiple windows/different files opened, guessing base window was still active, but not visible …really don’t know when it happened or how). I know I’ve migrated because I have started getting firebird errors (reason I stopped using it) And obviously will be worse as I didn’t follow the correct procedure for migrating.
For instance currently I can’t create a new record using a form - it won’t save, I get an error message. I didn’t have the primary key (ID2) on the form ( it is set to autovalue). For some reason if I create a box on the form for the primary key it seems I can save a new record but the primary key value becomes -1 (should be 25) but then I suspect that will cause problems when I try and enter further records…
I just want to go back to HSQLDB …for what I do it (usually) just works…is there anyway I can revert?
Like I said I didn’t know it had changed to firebird until I started getting error messages…some sql I usually run to remove records from a table - not executing, importing data from a calc doc - error etc etc Grrrrrr
Thanks

Turn off Tools>Options>Advanced>“Experimental features” in order to turn off the “upgrade” from embedded HSQL to embedded FB.
Close the “upgraded” document without saving in order to keep the embedded HSQLDB.
If you saved the document, restore it from a recent backup.

  • Disable experimental features. Migration wizard is an experimental feature.
  • Open the Base file in a packing tool. There will appear “content.xml” and “content_before_migration.xml”. Delete “content.xml” and rename “content_before_migration.xml” to “content.xml”. Save the file.

Now you could start the old HSQLDB again.
Don’t know what problems you got with Firebird. I would only create Firebird for new databases, because it is independent of Java, runs faster here and could set to external database by only using the extracted database as external file.

(updated, see comment post 9)

1 Like

Thanks
Sadly I’d already saved it (I do that regularly as I thought that crashing/losing data was an issue with HSQL) And I haven’t got a backup of the table I was working on before the accidental upgrade - I had been adding new data and editing it over the day…and I only back up first thing in the morning.

Thanks sorry I don’t know what a ‘packing tool’ is I’m running Linux cinnamon if that is relevant.
Can you let me know and I’ll see if I can do that - it would be great.
I don’t want to put this info on an external database, this is just a way of collecting lots of information from different sources for me to have access to throughout the year so (for now) HSQL is fine.
I did try with Firebird a few years ago but had lots of issues. I mainly use this database at around this time of year, under a bit of time pressure. I add quite a few new records and then just need to do an occasion update and run a few queries to extract data over the year.
To try and use firebird again I think I would need to take some time when I am not under pressure, have time to get to the bottom of the errors.
Thanks again

Your .odb is a zip file actually. Open the zip file with an appropriate program. If you don’t know which, rename the file from .odb to .zip and double-click.

EDIT: Screenshots of a file “diet_FB.odb” (HSQL, automagically converted to FB) opened with Ubuntu’s package manager. The zip archive contains both databases in the database directory and 2 versions of content.xml.
converted_hsql2fb_1
converted_hsql2fb_2

Get a more reliable external HSQLDB:

  • Download and open ExtractHSQL.py.odt
  • Click the install button and close.
  • Open your Base document with embedded HSQL
  • Call Tools>Macros>Run… MyMacros>pyDBA>ExtractHSQLDB>Main

Zip-tools under Linux: Here (KDE - OpenSUSE) is working ARK. Content could be edited directly.

Thanks - I didn’t know about .odb being a .zip file - a really handy thing to learn!
I opened the .odb as a zip, changed the content names but now I can’t open the database. I am getting a message that the file is corrupt, I did have to save as a .zip and then rename as .odb

image

If I click no it tells me it cannot be repaired and cannot be opened
If I click yes it opens as a blank writer doc - with the name xxx.odb (repaired document)

Thinking about renaming the files and seeing if I can at least open it as a firebird
This is current (renamed) files - what is odd is that the content.xmi file is dated 15th Aug - pretty sure that I had made changes to it after that (and before it became a firebird) -although like I said I didn’t know it had migrated On the 15th I would have been checking everything was ready/updated where nec to add the new data. (most new data was added via calc, then additional data added via forms on 23rd/24th)
image

Any advice?
Thanks again for your help

See the same behavior here - will have a look.
Seems it isn’t allowed to have saved content_firebird.xml inside the *.odb-file. When I delete this file the *.odb-file will be opened without any problem.

Brilliant - that now works.
Looking at it I have lost some data - but i was sort of expecting that (it has gone back to the 15th)
I was kind of resigned for that - at least (fingers crossed) when I make the changes now/enter the new data I won’t be constantly running into errors (famous last words)
Although do you know of a way that I could retrieve the data I have put in?
Or even just the redesigned form I made (which is probably took most of the time -although I should at least be able to remember how to change tab orders etc (which I had to remind myself about )
Thanks again

It should be possible to open the firebird database from a copy of that document and push the missing table data since the 15th into the HSQLDB.

I tried and couldn’t get it back. I bit the bullet and just did it all again. All done now, back to where I was on Sunday but can add new records, everything seems to be working as expected (no more errors so far)
Have turned off experimental so no annoying migration messages…
Thank you both (and I learned about an odb being effectively a .zip so not all a waste of time!)

All documents of MS Office (OOXML) and LIbreOffice (Open Document Format) are zip archives.