Migrating from 6.3 to 7.0
Overview
Section titled “Overview”This guide describes how to migrate from OpenKM CE 6.3 to OpenKM CE 7.0. It’s a major migration, not an update: OpenKM 7.0 stores the repository in a different database structure, so the data is copied from the 6.3 installation into a new 7.0 installation.
OpenKM 6.3 only receives security fixes, so migrating to 7.0 is recommended.
Why this is a major migration
Section titled “Why this is a major migration”OpenKM 7.0 changes how data is stored and versioned:
- Node versioning also tracks metadata changes, not only the document content: any change in the metadata of a node creates a new version.
- Each metadata group is stored in two tables of its own (current values and history), instead of the name-value table of 6.3.
- Because of these changes, the Updater utility can’t take a 6.3 installation to 7.0.
There are two ways to migrate:
- Database import (recommended): OpenKM 7.0 reads the 6.3 database directly and copies everything in a single run, including users, passwords, permissions and bookmarks. It requires OpenKM 7.0.6 or later.
- Repository export and import: export each part of the repository to disk from 6.3 and import it in 7.0. It doesn’t migrate users, roles or bookmarks.
Migration with Database import
Section titled “Migration with Database import”What is migrated
Section titled “What is migrated”- Folders, documents with all their versions (author, date and comment of each one), mails and their attachments.
- The repository roots:
okm:root,okm:categories,okm:templates,okm:personal(the personal folders of each user),okm:mailandokm:trash. - Keywords, categories, notes, metadata values, user and role permissions, subscriptions and locks.
- Users and roles, with their passwords: users log in to 7.0 with the same password they had in 6.3.
- Bookmarks.
Not migrated:
okmAdminalready exists in 7.0 and keeps its 7.0 password.okm:thesaurus, which doesn’t exist in 7.0.- The permissions of the repository roots themselves (
okm:root,okm:categories…): the 7.0 ones are kept. - The configuration (Administration > Configuration), profiles, automation rules, crontab tasks, mail accounts and reports, which must be set up again in 7.0.
- Documents that OpenKM 6.3 keeps in its database instead of on disk (
repository.datastore.backend=db).
Before you start
Section titled “Before you start”- OpenKM 7.0.6 or later, freshly installed and running. Don’t use it before the migration: the import is meant for an empty repository.
- Access from the 7.0 server to the 6.3 database: its JDBC URL (it’s in the
jdbc/OpenKMDSresource of the 6.3 Tomcatconf/server.xml), a user with read access and its password. If the database is on another server, it must accept connections from the 7.0 server. - Access from the 7.0 server to the 6.3 datastore, the folder where 6.3 keeps the document files, usually
<6.3 Tomcat>/repository/datastore. It can be the same folder if both are installed on the same server, a network mount, or a copy. - The metadata groups of 6.3. You can see their XML definition in the 6.3 Administration > Metadata, or in the
PropertyGroups.xmlfile of the 6.3 Tomcat folder.
Step 1 — Register the metadata groups in OpenKM 7.0
Section titled “Step 1 — Register the metadata groups in OpenKM 7.0”If OpenKM 6.3 used metadata groups, register them in 7.0 before importing, with the same group and field names. If a node has a metadata group that isn’t registered, the import stops with “Unknown property group”.
- Log in to OpenKM 7.0 as
okmAdminand go to Administration > Metadata. - Create each metadata group with its XML definition from 6.3. The format is the same (see Metadata XML definition).
- Enable the groups in the corresponding profiles so that users can see them.
Step 2 — Import from the 6.3 database
Section titled “Step 2 — Import from the 6.3 database”Go to Administration > Utilities > Database import and fill in the form:
| Field | Value |
|---|---|
| DB URL | JDBC URL of the 6.3 database, for example jdbc:mariadb://localhost:3306/okmdb. |
| DB user / DB password | User and password of the 6.3 database. |
| Source folder / Destination folder | Leave them empty. |
| Source datastore | Path to the 6.3 datastore folder as seen from the 7.0 server, for example /opt/openkm-6.3/tomcat/repository/datastore. |
| Thread pool size | Leave the default value. |
| Source tenant ID | Leave it empty. |
| Nodes, All repository roots, Users and roles, Bookmarks | Checked. |
| Node relations and the Concurrent options | Unchecked. |
Click on the Import button and wait. When it finishes, it shows “Import finished with N errors”. The details, and the reason of each error, are in the DatabaseImporter log in the 7.0 Tomcat logs folder.
Step 3 — After the import
Section titled “Step 3 — After the import”- Rebuild the search indexes, so that the imported documents and their content can be found.
- Check the result:
- The folder structure and a sample of documents, with their versions, metadata, categories and keywords.
- The personal folders of some users.
- Log in with a migrated user and their 6.3 password.
- Redo the configuration that isn’t migrated (configuration parameters, profiles, automation, crontab tasks, mail accounts…).
Users log in with their 6.3 password. OpenKM 6.3 stored it as an MD5 hash: 7.0 accepts it and replaces it with a BCrypt hash the first time each user logs in.
When everything is correct, stop OpenKM 6.3 and keep its backup.
Alternative: repository export and import
Section titled “Alternative: repository export and import”Use this method when OpenKM 7.0 can’t reach the 6.3 database. It migrates folders, documents with their versions, keywords, categories, notes and metadata, but not users, roles or bookmarks, which must be created again in 7.0.
Step 1 — Export the repository from OpenKM 6.3
Section titled “Step 1 — Export the repository from OpenKM 6.3”In the OpenKM 6.3 administration, go to Repository Export and repeat the export for each repository node:
| Repository node | Description |
|---|---|
| okm:root | Main document repository: all folders and documents. |
| okm:categories | Category taxonomy applied to documents. |
| okm:templates | Document templates. |
| okm:personal | Personal folders of each user. |
| okm:mail | Mail archive. |
| okm:trash | Deleted items (include it if they may need to be recovered). |
For each node:
- Source path: the repository node to export (for example,
okm:root). - Destination folder: a folder on the 6.3 server with enough free space for all the exported content.
- Check Metadata and History.
- Click on the Export button and wait until it finishes.
Step 2 — Transfer the exported data to the 7.0 server
Section titled “Step 2 — Transfer the exported data to the 7.0 server”Copy the exported folders to the OpenKM 7.0 server (SCP, SFTP, a network mount…), keeping their structure as it is, and write down their paths for step 4.
Step 3 — Register the metadata groups in OpenKM 7.0
Section titled “Step 3 — Register the metadata groups in OpenKM 7.0”The same as step 1 of the database import. Create the users and roles in 7.0 too, so that the imported permissions apply to them.
Step 4 — Import the repository into OpenKM 7.0
Section titled “Step 4 — Import the repository into OpenKM 7.0”In the OpenKM 7.0 administration, go to Utilities > Repository import and repeat the import for each exported node:
- Source folder: the folder with the exported data of this node.
- Repository path: the matching path in 7.0 (for example,
/okm:root). - Type: Full.
- Click on the Import button and wait until it finishes before importing the next node.
Then rebuild the search indexes and check the result as described in After the import.