Migrate from Derby to MySQL?

2,635 views
Skip to first unread message

Chris Haus

unread,
Jan 7, 2011, 3:26:14 AM1/7/11
to Constellio
Hello,

is there a possibility to migrate from derby to MySQL with all my
configuration, data etc.?

Thank you in advance :)
Bye, Chris

Vincent Dussault

unread,
Jan 7, 2011, 12:10:08 PM1/7/11
to const...@googlegroups.com
Hi Chris,

You can copy your data with SQuirreL's DBCopy plugin (http://dbcopyplugin.sourceforge.net/index.php?page=usage). 

1) Replace the content of %INSTALL_DIR%/constellio/tomcat/webapps/constellio/WEB-INF/classes/META-INF/persistence_base.xml with the content of persistence_mysql.xml (located in the same directory). Don't modify persistence.xml because its content is overridden when Constellio starts.
2) Launch Constellio, get to the login page, then shut it down. This step is necessary to create the table structure (will not work if you try it in SQuirreL). 
3) Install SQuirreL, configure it to connect to your MySQL and Derby databases. Make sure the DBCopy plugin is installed.
4) Connect to your MySQL database. Under tab "SQL", run the following command (without quotes) : SET FOREIGN_KEY_CHECKS=0;
5) Select all the tables ("Objects" tab / constellio / TABLE), right-click and choose "Delete Records". This will remove the default data (generated at step 2) but keep the table structure.
6) Connect to your Derby database. Select all the tables ("Objects" tab / APP / TABLE), right-click and choose "Copy Tables".
7) Switch to your MySQL database. Select the database ("Objects/ tab / constellio / TABLE), right-click and choose "Paste Tables".
8) Under tab "SQL", run the following command (without quotes) : SET FOREIGN_KEY_CHECKS=1;
9) Restart Constellio, it will be using MySQL and all your data will be there. :o)

Regards,

Vincent Dussault



--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes Constellio.
Pour envoyer un message à ce groupe, adressez un e-mail à const...@googlegroups.com.
Pour vous désabonner de ce groupe, envoyez un e-mail à l'adresse constellio+...@googlegroups.com.
Pour plus d'options, consultez la page de ce groupe : http://groups.google.com/group/constellio?hl=fr


Chris Haus

unread,
Jan 8, 2011, 5:13:41 AM1/8/11
to Constellio
Sounds quite tempting - unfortunately I already fail at step 3 ..
I want to connect from a remote computer to Derby.

For MySQL I figured it out - just needed to edit the my.cnf to listen
on all interfaces.

For Derby I found
java org.apache.derby.drda.NetworkServerControl start -h HOST -p 1368
http://db.apache.org/derby/manuals/admin/hubprnt14.html
but I couldn't find it in the code or property files.

Where do you start Derby or where can I tell it to let my remote
Computer in?
I use this URL:
jdbc:derby://10.8.0.1:1527//var/opt/constellio/tomcat/webapps/
constellio/WEB-INF/db/constellio_derby
and do I need a username and a password as well?
(as I read, by default it works without it)

Vincent Dussault

unread,
Jan 12, 2011, 4:06:34 PM1/12/11
to const...@googlegroups.com
Hi Chris,

Here is the documentation on how to use Derby Network Server : http://db.apache.org/derby/papers/DerbyTut/ns_intro.html

Regards,

Vincent Dussault


Reply all
Reply to author
Forward
0 new messages