Backup restoring 5.x
From OpenKM Documentation
In cause of a hardware failure you may need to restore a backup. Backups are very important for OpenKM because you store a lot of documentation on it.
First of all, we need to locate the right backup. In case of rdiff-backup you can list with:
$ rdiff-backup --list-increment-sizes /path/to/backup Sun Sep 11 05:00:19 2011 4.25 GB 4.25 GB (current mirror) Sun Sep 4 00:00:18 2011 13.3 MB 4.26 GB Sun Aug 28 00:00:13 2011 674 MB 4.92 GB Sun Aug 21 00:00:14 2011 5.50 MB 4.93 GB Sun Aug 14 00:00:16 2011 1.75 MB 4.93 GB Sun Aug 7 00:00:12 2011 288 KB 4.93 GB Sun Jul 31 00:00:13 2011 43.0 KB 4.93 GB Fri Jul 29 10:36:39 2011 5.56 KB 4.93 GB
Then we have decided to restore the backup of made on Sun Aug 28 00:00:13 2011:
$ rdiff-backup --restore-as-of 2011-08-28 /path/to/backup /path/to/destination
The --restore-as-of parameter accepts several formats. See rdiff-backup documentation for more info.
Inside of /path/to/destination you should see a directory /home/openkm, and inside it a couple of directories:
- db: The backup of the database.
- jboss-4.2.3.GA: The backup of the JBoss installation.
In case you have a MySQL database configured, these are the steps:
DROP DATABASE IF EXISTS okm_repo_bak;
DROP DATABASE IF EXISTS okm_app_bak;
CREATE DATABASE okm_repo_bak DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
CREATE DATABASE okm_app_bak DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
GRANT ALL ON okm_repo_bak.* TO openkm@localhost WITH GRANT OPTION;
GRANT ALL ON okm_app_bak.* TO openkm@localhost WITH GRANT OPTION;
We have already created a openkm user when the database was created on OpenKM installation. If you want to restore the backuped databases in another MySQL installation you will need to create this user. Refer to MySQL-OpenKM 5.0 for more info. |