Page 1 of 1

Reusing existing MySQL database and repository!

PostPosted:Thu Sep 04, 2014 2:33 am
by lpallard
Hello!

I just reinstalled OpenKM 6.3.0 (Build 8156) on a new Centos server. I am reusing an existing MySQL database and repository with thousands of documents from an older server.

While the installation on the new server and the configuration went very well, I messed up with the database and repository. Basically, I set the property of

hibernate.hbm2ddl=none

to

hibernate.hbm2ddl=create

Which basically seems to have totally deleted the repository!! Thanks Lord I had backups!

The MySQL database seems intact but I am not 100% sure. I may be restoring from a SQL dump if necessary.

This appeared in catalina.log
Code: Select all
014-09-03 22:21:52,753 [localhost-startStop-1] INFO  com.openkm.servlet.RepositoryStartupServlet- *** Application version: 6.3.0 (build: 8156) ***
2014-09-03 22:21:52,753 [localhost-startStop-1] INFO  com.openkm.servlet.RepositoryStartupServlet- *** Hibernate initialize ***
2014-09-03 22:21:54,863 [localhost-startStop-1] INFO  com.openkm.dao.HibernateUtil- Hibernate 'hibernate.dialect' = org.hibernate.dialect.MySQL5InnoDBDialect
2014-09-03 22:21:54,863 [localhost-startStop-1] INFO  com.openkm.dao.HibernateUtil- Hibernate 'hibernate.connection.datasource' = java:/comp/env/jdbc/OpenKMDS
2014-09-03 22:21:54,863 [localhost-startStop-1] INFO  com.openkm.dao.HibernateUtil- Hibernate 'hibernate.hbm2ddl.auto' = create
2014-09-03 22:21:54,863 [localhost-startStop-1] INFO  com.openkm.dao.HibernateUtil- Hibernate 'hibernate.show_sql' = false
2014-09-03 22:21:54,863 [localhost-startStop-1] INFO  com.openkm.dao.HibernateUtil- Hibernate 'hibernate.generate_statistics' = false
2014-09-03 22:21:54,863 [localhost-startStop-1] INFO  com.openkm.dao.HibernateUtil- Hibernate 'hibernate.search.default.directory_provider' = org.hibernate.search.store.FSDirectoryProvider
2014-09-03 22:21:54,863 [localhost-startStop-1] INFO  com.openkm.dao.HibernateUtil- Hibernate 'hibernate.search.default.indexBase' = /mnt/servers-content/openkm-datastore/index
[b]2014-09-03 22:21:54,864 [localhost-startStop-1] INFO  com.openkm.dao.HibernateUtil- Cleaning filesystem data from: /mnt/servers-content/openkm-datastore[/b]
How do I restore repository and SQL database with a working OpenKM install??

Thanks!!

Re: Reusing existing MySQL database and repository!

PostPosted:Thu Sep 04, 2014 10:02 pm
by lpallard
Update: I have tried the following steps:

Shutting down Tomcat
Restoring my repository to the same exact condition it was with the old server
Restoring the MySQL database from a backup
Starting Tomcat

But right after login, I get a red warning saying
Code: Select all
OKM-012024(GetRootFolder):  Database error
Could not execute query
Has something changed since release 6.3.0? I am 99.9% sure I was using 6.3.0 on the old server hence why I tried to just restore the data and start OpenKM back up but apparently it has problems with the database??

Any help would be appreciated!
Best regards

Re: Reusing existing MySQL database and repository!

PostPosted:Fri Sep 05, 2014 6:36 pm
by jllort
What is your initial OpenKM - MySQL backup version ? was a 6.3 version.
You got MySQL backup, right, also you got tomcat/repository backup ?

Re: Reusing existing MySQL database and repository!

PostPosted:Sat Sep 06, 2014 10:11 am
by pavila
Using the same database from two OpenKM instances is not a good idea. Why do you want this?

Re: Reusing existing MySQL database and repository!

PostPosted:Wed Sep 23, 2015 9:50 am
by sl0m0
I had exactly the same issue and solved it by doing the following:

1. Stop Tomcat
2. Edit OpenKM.cfg and set hibernate.hbm2ddl to update (again)
3. Restart MySQL database server
4. Start Tomcat

It should now be working.