Ir al contenido
Otras versiones

Cargando…

Backup and restore

Esta página aún no está disponible en tu idioma.

One of the most important things to have is an updated backup of your OpenKM.

If you have followed the installation instructions then you have configured OpenKM to use a production-safe database and optionally you have set a path the OpenKM repository data store.

In this case:

  1. First backup your database (make a SQL dump)
  2. Then backup your data on filesystem

Backup steps:

  • Stop Tomcat (optional).
  • Backup the database (mandatory).
  • Backup the repository folder (mandatory).
  • Start Tomcat (optional).

There is an alternative to traditional backup methods: you can export the whole repository from OpenKM Administration > Utilities > Repository export and choose metadata and history options. But we do not suggest this way of doing backups. For medium to large repositories we suggest some incremental backup solution.

In case you have OpenKM configured with MySQL or MariaDB you can follow these steps to backup and restore. For other databases check its corresponding command.

Terminal window
$ /etc/init.d/tomcat stop
$ mysqldump -h localhost -u root -p okmdb > /path/to/openkm/okmdb.sql
$ zip -r /path/to/backup/okm-backup.zip /path/to/openkm
$ /etc/init.d/tomcat start

After that, you will have a ZIP archive with the whole OpenKM installation and the exported database. Please, check before destroying the installation. We always recommend to restore the backup to ensure you have all the required files.

Please, note that you have to create the database if wasn’t created previously. In case of MySQL or MariaDB install it:

Terminal window
$ sudo apt install mariadb-server

And execute the following sentences:

CREATE USER 'openkm'@'localhost' IDENTIFIED BY 's3cr3t0';
CREATE DATABASE okmdb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
GRANT ALL ON okmdb.* TO 'openkm'@'localhost' WITH GRANT OPTION;

Keep on mind that the user and database name may be different in you case. Please, take a look at the installation report or check it at $TOMCAT_HOME/conf/server.xml 

Once created restore the database and files:

Terminal window
$ unzip /path/to/backup/okm-backup.zip -d /path/to/restore
$ mysql -h localhost -u root -p okmdb < /path/to/restore/okmdb.sql

Set the permissions according to the user who start OpenKM:

Terminal window
$ sudo chown openkm:openkm /path/to/openkm -R

Install the required dependencies:

Terminal window
$ sudo apt install gawk imagemagick libreoffice tesseract-ocr

Once restored, verify file permissions, start OpenKM and make a repository check. See Repository checker.