Porting database to 5.3

Thanks for clearing up about the embedded database. Question - the latest split wizard hsqldb.jar v2.3.2 has both hsqldb.jar and sqltool.jar built-in. Do these two files still need to be in the driver directory?

I forgot exactly how it works. Just ran a quick test. It does already places those in the driver directory. That is all you need.

I actually had to create a driver directory and copy them there for it to work. Otherwise it complained it could not find them. Now the next problem. It is complaining about an error in the script. It is not that long but I don’t think it will fit in a comment. How do I transfer that file to you so you can look t it?

The exact errors -

The connection to the data source “Split_HSQLDB_2.3.2_Wizard_v3d” could not be established.
SQL Status: S1000
Error code: -25
error in script file line: /home/doug/Documents/CHS68_split/database/CHS68-split 3

I have given you some karma. You can post a copy of your file in your question.

Thanks - added.

Nothing seems to be liking your file. I have found a problem from a while back with HSQL and a similar error. It does not help your situation. Here is my last suggestion. Create a new empty Split DB. Create a new directory. Place a copy of the wizard within. Run the wizard to create a new split DB.

Now open your embedded DB using LO v.4.2 which you said works. Copy the table from the old embedded & paste into new split. Then see if you can open the table in the new split DB.

OK - before I do that there is something I did not tell you . I am trying to do this split in the 4.2 code. I can easily move the directory over to a 5.3 system and try again there. That might be the problem?

No, that won’t make any difference. The split DB is using its own HSQL (in driver directory). The Embedded is using the HSQL in LO 4.2. The problem seems to lie in the 4.2 HSQLDB. What I am hoping to get around here is the script problem. By doing this process, the split should create a new script for the copied table.

OK, I have the new DB open but I have not created the table. Do I need to manually create the table with the same specs as the old one?

No. Just open both old & new .odb then right click on table name in old .odb & select Copy. Then right click in table name area in new split db & select Paste. Once pasted, try to open the table in new split DB.

OK It worked! I copied all data over - queries, reports, forms and all seems to work. So I can move (or copy) this directory over to another system and run it from there? Can I change the names of the files in the data directory - mydb.data etc. as long as I change them all and of course keep the extent? Can I change the name of the split wizzard to match a more meaningful name for this database? What is the best way to make backups? Before I just copied the one odb.

For whatever its worth I added the new script to the question for you to view.

So far, so good. There are things you need to know about split DB’s. First you can’t change existing field definitions. You can add/delete but not change fields. Second, and the reason this was a last choice, a copied table loses its auto-increment field if there was one. If you had one, usually for the primary key, it doesn’t work right now. To fix, see this post.

As for you questions:
You should be able to move the entire directory anywhere. Backups are the same. The entire folder becomes the database with the Base files in the .odb. I believe you can change the data directory names and .odb without a problem. Make a copy and try it on the copy. It has been quite a while since I worked with that (I mostly use MySQL now).

Please note after all this frustrating effort, you’ll have a much better set-up, greatly reduced chance of data loss/corruption, newer DB engine which has more SQL capabilities and ability to upgrade HSQLDB engine by just changing the driver files.

IMPORTANT! Before proceeding with any changes, let me know if you do have the auto increment problem.

OK to summarize the ID field auto increment change I would do this (my table name is CHS68) -

ALTER TABLE CHS68 ALTER COLUMN ID SET GENERATED BY DEFAULT AS IDENTITY

Next get the highest value already in use in the table and add 1 to that for use in the next statement:
ALTER TABLE CHS68 ALTER COLUMN ID RESTART WITH XXX
where XXX = that highest value + 1.

Then delete the column for ID as per example in XML file. I have already identified that but not changed.

Correct?

Just saw your question. Yes, if I try to enter another record I get the integrity error that the previous questioner had.

OK! It appears you have found all necessary information. Of course XXX is an actual number ( one higher than the current ID). It appears all looks good to go.