• Reusing existing MySQL database and repository!

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #29811  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!!
 #29818  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
 #29837  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 ?
 #40599  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.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.