Page 1 of 1

OpenKM database backup

PostPosted:Tue Jul 24, 2018 4:26 am
by jorseng
Hi Jllort,

My setup is using mysql as database, i plan to write a simple script to "mysql_dump" the sql image daily.
Is it sufficient to just backup the sql file for restore or do i need to also backup the repository folder?

What are the options to create a backup image daily in openkm?

Regards,

Re: OpenKM database backup

PostPosted:Tue Jul 24, 2018 2:29 pm
by dferguson
I have deployed this example...

https://docs.openkm.com/kcenter/view/ok ... rsync.html

but have added a full zip/tar of the entire tomcat folder, which includes all the configuration, property group, workflow, and report files unique to my deployment.

I do this nightly off a crontab job and write the output to a log file. I am not sure if the dump is better than archiving the entire folder from a data perscpective.

Re: OpenKM database backup

PostPosted:Wed Jul 25, 2018 3:17 am
by jorseng
Hi dferguson,

Thanks for your suggestion! There is a part which i would like to understand in regards to database, if i am using [h2] database then i am certain that i can just zip the folder and store it as backup as the image itself is stored in the tomcat folder.

As for mysql, the sql image is stored in the local machine and the repository files in the tomcat folder. So if I only backup the tomcat folder wouldn't i be missing an important part of the database?

My priority for the backup is just the data itself, because the tomcat folder with all the configuration and setups will be constant for a long while and its backup does not need a nightly copy.

The data however is written everyday, and once the files are uploaded to the system, it will be removed from the local machine after some time. Thus it is crucial to ensure the data uploaded to the system can be recovered no matter what.

My question is, in order to retain full recovery, do i need both repository folder AND sql image?

Re: OpenKM database backup

PostPosted:Wed Jul 25, 2018 12:38 pm
by dferguson
viewtopic.php?f=5&t=21668

Here is a little more information when I was trying to figure out the same. I am not sure it totally answers you question, unfortunately.

Re: OpenKM database backup

PostPosted:Thu Jul 26, 2018 11:55 am
by redink
Hi jorseng,

yes, you need to back up both SQL and data repository. OpenKM does not store the files as BLOBs in SQL but in the data directory using the UUID.

Re: OpenKM database backup

PostPosted:Fri Jul 27, 2018 2:25 pm
by jllort
Good practice is restore the backup into another server to check everything goes right. After restore the backup go to Administration > Tools > repository checker to verify the data integrity.

As said the previous user, you must backup the database and datastore folder. I suggest backup database and entire tomcat folder ( where usually into you have the repository folder ) and from this scenario you can quickly restore full application.