HI Andrew!

Here are the notes I made when I used javaeoutil to convert a mysql to frontbase db. This was from the Xcode days so I don't think I was using prototypes.

----
Move the models from both the old project and the new one to the desktop
Change the connection dictionary so that the old model points to MySQL and the new one to FrontBase

Final Successful Steps (pure migration from MySQL to Frontbase with the same data model:

1. Run the javaeoutil command to export the entire database.
cd /System/Library/WebObjects/JavaApplications/javaeoutil.woa
./javaeoutil -Xms128m -Xmx512m dump ~/Desktop/XXXX.eomodeld -source database -dest plist ~/Desktop/Database.plist 2. Run the import command and watch for the entities that generate errors: ./javaeoutil -Xms128m -Xmx512m dump ~/Desktop/XXXX_new.eomodeld - source plist ~/Desktop/Database.plist -dest database

*** Important notes about importing***
When you do the import, you must ensure that your javaeoutil.woa classpath.txt file contains the plugin and driver for the database you are importing to (i.e. Frontbase).

This is an example of the error messages that can get generated:
Exception running dump:
com.webobjects.jdbcadaptor.JDBCAdaptorException: No suitable driver
at com.webobjects.jdbcadaptor.JDBCContext.connect (JDBCContext.java:244)
Advice from Chuck:
It all comes down to the classpath. The easiest is probably to add it to /System/Library/WebObjects/JavaApplications/javaeoutil.woa/Contents/ MacOS/MacOSClassPath.txt

I added the following lines to the MacOSClassPath.txt file:

# adding additional items to the classpath for use with FrontBase
/Library/Frameworks/FrontBasePlugIn.framework/Versions/A/Resources/ Java/frontbaseplugin.jar
/Library/Java/Extensions/frontbasejdbc.jar

You will also likely have to turn off all integrity checks in EOModeler (remove foreign key constraints) as you are importing into the database. Once it has been populated you can create the FK constraints once again.

This is an example of the error messages that can get generated:
 dumping Post to db
Exception running dump:
com.webobjects.jdbcadaptor.JDBCAdaptorException: Exception condition 361. Integrity constraint violation (FOREIGN KEY, POST._C0000000323 (topicID=6)).

3. Delete timestamp fields out of the destination eomodel for the entities that give errors:
comment (delete the timestamp column)
4. Run the import command for those specific entities. Should say that it is ignoring the timestamp field(s) ./javaeoutil -Xms256m -Xmx512m dump ~/Desktop/XXXX_new.eomodeld - entities Comment -source plist ~/Desktop/Database.plist -dest database

[2006-11-17 12:27:09 PST] <main> null
ignoring timestamp in Comment
 dumping Comment to db
[dual125:WebObjects/JavaApplications/javaeoutil.woa] dholt%

5. Export id and timestamp columns from problem tables into .csv i.e.
SELECT comment.timestamp,
        comment.comment_ID
FROM comment
ORDER BY comment.comment_ID ASC

6. Deal with those tables individually. I found deleting the timestamp attributes out of the destination model to work great. Then once you are done, you can create SQL statements in the .csv file that looks like this: UPDATE post SET "TIMESTAMP"= TIMESTAMP '2004-02-27 09:32:00' WHERE "POST_ID"=10;

7. Create a Text Factory in BBEdit. What I did was search and replace on:

\r" --> \rUPDATE post SET "TIMESTAMP"= TIMESTAMP '
"," --> ' WHERE "POST_ID"=
"\r --> ;\r

8. Run the resulting script file in FrontBase




On 28-Aug-08, at 4:03 PM, Andrew Lindesay wrote:

Hello;

I am investigating use of "javaeoutil" –– does anybody know of any notes on how to use the tool and I will write this up on the wiki.

cheers.

___
Andrew Lindesay
www.lindesay.co.nz

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/programmingosx %40mac.com

This email sent to [EMAIL PROTECTED]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to