Migration Derby DB to MySQL
Today I migrated successfully this Blog from a Derby DB into a MySQL Database.
From the Apache Blog Software Roller this is no big deal. And as I run the blog on a Glassfish Server there was only a new JDBC Database Pool necessary which is connected to the JDBC Ressource used by the roller web app (jdbc/rollerdb).
But what to do with all the data? Therefore I used the open source software tool OpenDBCopy. With this tool you can migrate the data from one database system into another database system independent form the platform.
As there was no provided Derby Driver Setting provided I used "PostgreSQL" as a dummy and edited the driver class and url setting as you can see in the first picture.
To migrate the data from one database into another it is necessary that in both databases the database scheme still exists. Also as the destination database is still empty. To get the database schema created on my mySQL database I started roller first with the new mysql database connection to force roller to create a new database schema. So next I was able to copy my data from the source database (Derby) to the destination (MySQL) successfully with openDBCopy:
That's it. Next I restarted my web server and now my blog runs on MySQL with all the data.
Thanks to the developers from OpenDBCopy!
Posted at 07:51AM Jan 12, 2010
Posted by: Ralph
Ubuntu - MySQL - Glassfish
To install MySQL on Ubuntu to be used in a Glassfish JEE App is very easy.
You can download and install MySQL Server using the Synaptic Tool in Ubuntu. During Setup you will be asked for a root password. this is a password for the user "root" inside the mySQL Server. So its not your Linux root password.
After intalling mysql server you can easily start and stop it with
> sudo /etc/init.d/mysql start
> sudo /etc/init.d/mysql stop
To get into the mysql console use
>mysql -u root -p
There you will be ask for the mysql root password.
To create a new database use the following command form the mysql console:
mysql> create database my_database;
Now you can setup the JDBC Pool inside Glassfish server.
First download the JDBC Driver form mysql download page and put the 'mysql-connecto-java-5.1.x.jar' into glassfish/domains/domain1/lib/ext
use the following Class Name to configure you JDBC Pool: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
Use the additional params:
- databaseName : [you_database_name]
- user: root
- password : [you mysql admin password]