Database import
The database importer copies users, roles, bookmarks and repository nodes from the database of another OpenKM into the current one. It reads the source database directly through JDBC and doesn’t modify the source OpenKM. It’s the recommended tool to migrate from OpenKM 6.3 to 7.0.
| Field | Description |
|---|---|
| DB URL | JDBC connection URL of the source OpenKM database, for example jdbc:mariadb://dbserver:3306/okmdb. The current OpenKM server must be able to reach it. |
| DB user | User of the source OpenKM database. Read access is enough. |
| DB password | Password of that database user. |
| Source folder | UUID of a folder in the source OpenKM. Its content, not the folder itself, is imported into the destination folder. Not needed with All repository roots. |
| Destination folder | UUID of the folder of the current OpenKM where the content of the source folder is imported. Not needed with All repository roots. |
| Source datastore | Optional. Folder where the source OpenKM keeps the document files, usually <repository.home>/datastore (for instance /opt/openkm/tomcat/repository/datastore). When set, the file of each imported document version is copied from there, so it must be readable from the current OpenKM server. When empty, the files must be copied separately (see Document files). |
| Thread pool size | Number of threads used by the concurrent options. |
| Source tenant ID | Optional. Only used when the source database has tenants (OpenKM 6.4 or later), and 1 by default. Leave it empty when importing from OpenKM 6.3. |
| Concurrent documents | Import the documents of each folder in parallel, using the thread pool. |
| Concurrent folders | Import the subfolders of each folder in parallel. |
| Concurrent records | Import the records of each folder in parallel. OpenKM 6.3 has no records. |
| Concurrent mails | Import the mails of each folder in parallel. |
| Nodes | Import folders, documents with all their versions, records and mails, with their keywords, categories, notes, metadata, permissions, subscriptions and locks. |
| All repository roots | Instead of a single folder, import okm:categories, okm:templates, okm:root, okm:personal, okm:mail and okm:trash into the roots of the same name. Roots that don’t exist in the current OpenKM, such as okm:thesaurus, are skipped. |
| Users and roles | Import users and roles. Users that already exist, such as okmAdmin, are not modified. |
| Node relations | Import node relations. OpenKM 6.3 has no relations, so this option is skipped when importing from it. |
| Bookmarks | Import the bookmarks of the users. |
How it works
Section titled “How it works”- Nodes keep their UUID, author, creation date and version history, so categories, bookmarks and links keep pointing to the right node.
- If the destination already has a folder with the same name (for instance
okm:personal/system), the content of the source folder is merged into it. - Users keep their password. OpenKM 6.3 stores passwords as MD5 hashes: OpenKM 7.0 accepts them and replaces each one with a BCrypt hash the first time the user logs in.
- Metadata values are only imported for the metadata groups registered in the current OpenKM, with the same group and field names. Register them in Metadata before importing: if a node has a metadata group that isn’t registered, the import stops with “Unknown property group”.
- The permissions of the repository roots themselves (
okm:root,okm:categories…) are not copied: the ones of the current OpenKM are kept. - The progress and the errors are written to the
DatabaseImporterlog, in the Tomcatlogsfolder.
Document files
Section titled “Document files”The database only describes each document version. The file itself is in the datastore of the source OpenKM, in a path built from the UUID of the version, and OpenKM 6.3 and 7.0 use the same layout. There are two ways to bring the files over:
- Set Source datastore, and the importer copies the file of every imported version.
- Or copy the source
datastorefolder into the datastore of the current OpenKM (by default<repository.home>/datastore), for instance withrsync -a.
The importer can’t copy documents that the source OpenKM keeps in its database (repository.datastore.backend=db).
Import
Section titled “Import”- Register in the current OpenKM the metadata groups used in the source.
- Set the DB URL, DB user and DB password.
- Set the Source folder and the Destination folder, or check All repository roots.
- Optionally, set the Source datastore and the Source tenant ID.
- Check what to import: Nodes, Users and roles, Node relations and Bookmarks.
- Click on the Import button and wait for the “Import finished with N errors” message.
- Rebuild the search indexes so that the imported documents can be found.