• Backup and Restoring

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
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.
 #36735  by TMac
 
Hello.

I have joined an organisation where openkm is used and backups were performed by copying the entire Tomcat folder (and renaming with a date). I am pretty sure OpenKM was shut down before the copying was done (but it was done by a former employee, so I can't be certain). We only use Tomcat for OpenKM, so I also assume that if Openkm was shutdown, Tomcat was stopped by the shutdown process - File/Exit (again, I might be wrong in this).

Now openkm has crashed, we have reinstalled and the software runs fine. The data is not visible, so I believe it needs to be reimported from backup.

We have tried a copy/paste from the backed up Tomcat folder to the new openkm Tomcat folder. We have tried copy/past the Repository folder inside the Tomcat folder only. We have also tried importing through the application of both the entire Tomcat folder and of the Repository folder on its own. We have even tried re-indexing with the Lucerne option as was indicated in one of the help files. I have looked through the online information about backup and restoring and I think we are doing everything right. What are we missing? Is there another folder somewhere that we are missing? I have a feeling we are bringing in the information, but just can't see it.

We are able to login to OpenKM through the generic admin login and we see a root folder structure.

1. Are we conducting the import / restore of the backup copies correctly?
2. Were the backups even done correctly or are they all corrupted?
3. What is the next step to recovering the data?

Thanks very much.
 #37379  by jllort
 
First of all, use MySQL ( OpenKM comes by default with HSQL database, but only for rapid test, is not good idea use on production ).
If you do a backup of all tomcat folder ( what includes tomcat/repository ) and database ( MySQL ) then you got all you need to restore it without problem.

With catalina.log file I can give you some idea about what happened. Post here if you got older one when error began.
 #37436  by TMac
 
Hello,
Thanks for the reply. The log files are not being accepted due to a strange problem with file format (I have tried .log and .txt files...I will figure this out eventually and will upload). I will attach a catalina log file just before or at the crash of openkm (so I am not sure if this is a log while openkm was still functioning...it's the last one we have). I will also attach one of the openkm now that we have reinstalled and tried to re-import the data.

A stupid question first: you mention the tomcat/repository folder AND a database folder. Is the database folder within the Tomcat folder or is this a separate folder? If it is separate, then maybe there is no backup. They were only backing up the Tomcat folder.
Thanks
 #38385  by pavila
 
He means that you should backup the $TOMCAT_HOME/repository directory and the database dump. Anyway I would recommend to backup the whole $TOMCAT_HOME directory.
 #38399  by TMac
 
Thank you Pavila,

It sounds like we have backed up the data correctly. They were copying the entire Tomcat folder, so I think we should have the data...somewhere.

I also checked our new OpenKM installation (we used the smart installer). The openkm.cfg file reads:
Code: Select all
hibernate.dialect=org.hibernate.dialect.HSQLDialect
hibernate.hbm2ddl=none
So I don't think we are overwriting the database every time we log it.

However, we can only see a generic root folder file structure. We have used the import tool within openkm and imported the entire tomcat folder, which made no difference. We then imported only the repository and had no luck either. The importing takes a number of hours, which makes sense to me and it completes without problems. But then nothing shows up. Are we running the import incorrectly?

Thanks.
 #38401  by jllort
 
Imported the entire tomcat folder ? why ? If you got a backup of your tomcat/xxxx you should restore and start it, not import to new installation.
 #38404  by TMac
 
Hi Jllhort,

Thanks for the reply. I feel I am missing a step.

When you say restore tomcat/repository and start it, do you mean copy it from backup and replace the current tomcat/repository? - We have done this.
And start it, you mean just start up OpenKM or do you mean some other service (like apache)?

Here is what happened in detail. Maybe it will help:
We were logged in to OpenKM and the server froze. OpenKM refused to open after this point.

Here is what we have done:

Original OpenKM installation:
1. copy and replace entire Tomcat folder from backup. Start openkm. OpenkM would not start.
2. decided to reinstall OpenKM, believing the installation had somehow corrupted and would not read the backup. We used the installer tool.

New OpenKM installation:
1. started openkm with default setup. It worked but with empty root folder structure.
2. copy and replace tomcat/repository folder from backup. Start openkm. same empty root folder structure.
3. start openkm and import repository folder. same empty root folder structure.
4. copy and replace entire tomcat folder from backup. Start openkm. same empty root folder structure.
5. start openkm and import entire tomcat folder. same empty root folder structure.

How can I restore and, especially, start the backup in our openkm without importing? copying the repository hasn't worked...unless I am missing a step.

Do I replace the new install repository with the backup and then??? I assumed that openkm would look at this repository, but maybe I have to point to it somehow? Other than starting openkm, do I need to start the database separately?

Sorry for the questions. As I've mentioned, I never did the initial setup of openkm and the software is new to me.

Thanks.
 #38466  by jllort
 
If you copy repository folder from backup to new tomcat and not starting correctly then you are on a throuble, because that should show to you the older repository. I suspect the reason why it happens. Take in mind before starting the OpenKM ( first time ) to change hibernate.hbml parameter to none value otherwise when you start openkm ( first time ) you're building the repository again.
 #38467  by TMac
 
Thanks.
Yes, I think I understand. However, I made sure that hibernate is set to none. Also I have investigated further. If I search right to the bottom repository folder I do find the actual files. I also see them referenced in the script file in the backup. When I copy this over to the tomcat folder though the openkm and then I start openkm it stops working again. It makes me think one of the configuration files in the repository folder is causing the problem. I will search some more.
 #38468  by jllort
 
1.- stop openkm
2.- delete catalina.log file
3.- start openkm

and upload here the catalina.log file
 #38528  by TMac
 
Hello Jllhort,

I am, finally, uploading the catalina.log file.

Please let me know if it shows anything about locating the files.

Thanks
Attachments
(7.47 KiB) Downloaded 316 times
 #38544  by pavila
 
You should check permissions:
Code: Select all
org.hsqldb.HsqlException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@7b4acf7c[file =/home/bch/openkm-6.3.0-community/tomcat/repository/okmdb.lck, exists=false, locked=false, valid=false, ] method: openRAF reason: java.io.FileNotFoundException: /home/bch/openkm-6.3.0-community/tomcat/repository/okmdb.lck (Permission denied)
 #38568  by TMac
 
Hello again,

So we have a fresh install of openkm. There is a okmdb.lck file present in the repository. In our backup repository there is no okmdb.lck file present.

We replaced the fresh install repository folder with the backup repository folder. We also placed the okmdb.lck file in the repository folder with read/write permissions.

We now get an error and cannot get to the login page. It is a similar error to what we had before.

I am a bit confused. I thought the lck file would only appear when a database/openkm is open. I am not sure why it appears in the fresh install folder.

I am attaching a log file of the recent start/stop openkm.

Thanks,
Attachments
(58.7 KiB) Downloaded 238 times
 #39002  by jllort
 
The error is clear
Code: Select all
java.lang.OutOfMemoryError: Java heap space
You do not have enought memory. Modify setenv.sh or setenv.bat and increase MaxPermSize value, for example to 1024mb ( after the modification start application ).
 #39202  by TMac
 
Hello again,

Unfortunately, I am back on the forum with no solution. I tried increasing the memory size, but the log files still list memory as an issue. I increased max memory to 1024 and have this message:
Class: org.apache.jasper.JasperException
Message: javax.servlet.ServletException: com.openkm.core.DatabaseException: Cannot open connection

I read through the log file and there are a number of references to not being able to open a connection to the database. I stopped openkm, deleted log files, started openkm and am now attaching the fresh error logs. There appear to be a lot of errors, but I am hoping they are propagating from a small number of errors in the configuration.

I would appreciate any advice on this.

Thanks
Attachments
(12.49 KiB) Downloaded 235 times

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.