Antville Project

Antville DB export script 0.0.1

So here's a simple Antville DB export script as promised yesterday. It lets you export existing Antville data from one database (say, the embedded Mckoi database in Antclick) to another (say, MySQL).

Here are the steps to take. I assume that you'll be migrating from Antclick/Mckoi to Mysql, but with a few changes it will work in any direction.

  1. Update your installation of Antville to Helma 1.2.4 by downloading helma.jar and saving it to the lib directory of your antville installation (make a backup copy of the old version before)
  2. Make sure you have a database driver for the new database you want to use. If it is MySQL, you can download the JDBC driver from the MySQL web site. Place the driver .jar file into the lib/ext folder of your installation.
  3. Set up MySQL and import antville_mysql.sql, which you should find zipped up inside apps/antville/db_support.zip. This can be done with

    mysql -u root -p < /path/to/antville_mysql.sql

    You should be prompted for the mysql root password. You might want to change the antville user password (IDENTIFIED BY 'antville') in the GRANT statement at the beginning of the file before performing this step!

  4. Open file apps/antville/db.properties in your favorite text editor and add the definition for the new database with the name antville-new:

    # Properties of antville datasource antville.url=jdbc:mckoi:local://./db.conf antville.driver=com.mckoi.JDBCDriver antville.user=admin antville.password=entwil

    antville-new.url=jdbc:mysql://localhost/antville antville-new.driver=org.gjt.mm.mysql.Driver antville-new.user=antville antville-new.password=antville

    Note that you might need to change the last line (antville-new.password=xxx) if you changed the password in step 3. The jdbc:mysql: URL may also look slightly different depending on your setup.

  5. Download the following file and save it as apps/antville/root/export.hac

    export (application/octet-stream, 2 KB)

  6. Start up Antville, open your browser and point it to http://localhost:8080/export (with http://localhost:8080/ being the home page of your Antville installation). If you get a page with many yellow lines and no mention of the word "error", you're 90% done.
  7. Stop Antville and open file apps/antville/db.properties again. This time, you remove the original lines and change the lines you added in step 4 from "antville-new" to "antville":

    antville.url=jdbc:mysql://localhost/antville antville.driver=org.gjt.mm.mysql.Driver antville.user=antville antville.password=antville

The next time you start Antville, you should be running with your new database. If not, something went wrong. In any case, I'd be curious to hear.

comment    

 
Boolean, April 17, 2003 at 11:09:32 PM CEST

Good info!

Sounds very clear to me - thank you very much for your work.

I however have problems to start antville with mysql in the first place. I wanted to try antville (antclick-1.0) with mysql as a "warmup" on a test server before I would tackle the conversion.

This is what I did:

I created the database within mysql using your script. Everything worked fine, 'mysqlshow' shows that the database was flawlessly created.

I changed apps/antville/db.properties:

myDataSource.url = jdbc:mysql://192.168.0.5/antville myDataSource.driver = org.gjt.mm.mysql.Driver myDataSource.user = antville myDataSource.password = xxx

(I changed the password in your database creation script before).

Then I copied mysql-2.0.14.jar to lib/ext and removed mckoi.jar there.

hop.sh was adjusted to local parameters and worked fine with mckoi before.

however, when I started antville and connected to it with a browser, it greets me with the following error:

Error in application 'antville':

Error retrieving Node: java.sql.SQLException: Datasource is not defined: antville.

I guess it must be my fault, but what is wrong?

my installation is under /opt/antville, if this is of any concern.

Thank you...

link  

 
hns, April 17, 2003 at 11:15:32 PM CEST

Replace the "myDataSource" in db.properties with "antville", that should do the trick. Antville/-click is configured to save its data into a datasource called "antville".

link  

 
Boolean, April 29, 2003 at 11:45:38 PM CEST

Cool, just a minor problem...

I tested your script and it worked wonderful. Of course I had to fight with MySQL the days before - but that was Debians fault and is a completely different story.

One problem though: the Umlaute are not displayed properly. I checked with lynx also and it turned out that ß, ä, ö, ü etc. are all being replaced with "�".

link  

 
robert, April 30, 2003 at 10:42:09 AM CEST

are umlauts correct in your mysql db?

link  

 
Boolean, April 30, 2003 at 1:46:15 PM CEST

interesting...

Umlauts are correct in the mysql DB. I looked in AV_CONTENT and AV_RAWCONTENT, both displayed ä, ö, ü etc.

any hints?

thanks!

link  

 
robert, April 30, 2003 at 1:47:44 PM CEST

try

restarting both helma and apache

link  

 
Boolean, April 30, 2003 at 2:22:19 PM CEST

already

did that before. even restarted the whole server ;) but did not help. btw, i am using mysql 4.0.12.

############ SOLVED: I just downloaded a fresh JDBC from: www.mysql.com

Now everything seems to work fine. Thanks!

link  

 
hns, April 30, 2003 at 3:29:56 PM CEST

Sorry

my fault. The MySQL driver I linked to was old. I updated step 2 above (and also here) to get the driver directly from MySQL.com.

link  


... comment


The Antville Server Fund has been a great success. Thanks to everybody who contributed!
online for 8546 Days
last updated: 1/4/11, 10:22 AM
status
Youre not logged in ... Login
menu
November 2024
SunMonTueWedThuFriSat
12
3456789
10111213141516
17181920212223
24252627282930
July
recent
zfuture's house here is zfuture's
house
by zfuture (7/31/03, 2:59 AM)
i understand your concerns however,
i hardly can think of a solution. certainly, if the...
by tobi (7/29/03, 9:47 AM)
Found several more similar sites
listed This is getting to be quite a concern to...
by cobalt123 (7/27/03, 7:56 PM)
Second Post Alert on Referrer
bug livecatz I put this into "help" and now here:...
by cobalt123 (7/26/03, 7:14 PM)
well it's not easy to
find from here, anyway. think we should include a link,...
by tobi (7/24/03, 11:25 AM)
So finally I found
the helma Bugzilla - stupid me.
by mdornseif (7/24/03, 10:28 AM)
clock not that it's particularly
earthshattering but the antclock is running slow by about 15...
by kohlehydrat (7/23/03, 8:25 PM)
but blogosphere.us isn't can't really
be rated as spam can it?
by kohlehydrat (7/23/03, 8:08 PM)
More referrer spam www.webfrost.com
by Irene (7/23/03, 7:55 PM)
How to log skin names
I accessed to console?? Hi, I would like to know...
by winson (7/23/03, 4:12 PM)

Click here to get an XML version of this weblog.

Made with Antville
powered by
Helma Object Publisher