Migrate to another store¤
Introduction¤
This page describes how to move an eccenca Corporate Memory deployment from one knowledge graph store to another, for example from OpenLink Virtuoso to Ontotext GraphDB. The result is a deployment on the new store with the same knowledge graphs and Build (DataIntegration) projects as before.
The migration runs between two deployments: the existing one (source) and a new one on the target store (target). The content moves with cmemc. Queries that use store-specific SPARQL extensions are adapted afterwards.
The following parts of a deployment are affected:
| Part | Where it is kept | Migration |
|---|---|---|
| Knowledge graphs, including the query catalog, shapes and the workspace configuration | the store | export and import with cmemc |
| Build projects | graphs in the store, plus resource files held by Build | export and import with cmemc |
| Connection to the store | the configuration of Explore backend (DataPlatform) | configure for the target store |
| Connection of Build to the store | none, Build accesses the store through Explore backend | no change |
Prerequisites¤
- Both deployments run the same Corporate Memory version.
- A cmemc connection to each deployment, with an account that may read and write all graphs and projects.
In the examples on this page, the connections are named
sourceandtarget. - Disk space on the machine running cmemc for an export of all graphs and the workspace.
1. Deploy the target store¤
- Size the target store for the data volume of the source deployment, see Triple Store Sizing.
- Install and configure the store. Store settings that affect Corporate Memory are listed in Quad Store Configuration.
2. Connect Corporate Memory to the target store¤
- Set up a Corporate Memory deployment as described in the installation scenarios.
- Configure Explore backend for the target store.
The
storesection of the configuration selects the store withstore.typeand holds the store-specific settings. See the store-specific configuration pages under Explore backend (DataPlatform). - Leave the Build configuration as it is.
With the default
backendworkspace provider, Build keeps its workspace in the store through Explore backend, see Workspace Providers.
3. Transfer the content¤
-
Export all knowledge graphs and the workspace from the source deployment:
Both archives are needed. Build projects are stored as graphs, but only the workspace archive contains the resource files of the datasets.
-
Import both archives into the target deployment, the store archive first:
cmemc -c target admin store import <date>-source.store.zip cmemc -c target admin workspace import <date>-source.workspace.zipWarning
admin store importreplaces all graphs of the target deployment and deletes every graph that is not part of the archive.
The export and import commands, their options and the parts of a deployment they do not cover are described in Backup and Restore. User accounts, installed Python packages and the deployment configuration are transferred separately.
4. Validate the migration¤
-
Compare the triple count of every graph on both deployments:
-
Check that all Build projects load without errors:
-
Compare the results of the
SELECTqueries in the query catalog. List them withcmemc query list --filter type SELECT, run each one on both deployments, and compare the output:cmemc -c source query execute <query-iri> --accept text/csv > source-result.csv cmemc -c target query execute <query-iri> --accept text/csv > target-result.csv diff source-result.csv target-result.csvFill the placeholders of a parameterized query with
--parameter <key> <value>. A query that fails on the target deployment or returns different results is adapted in the next step.
5. Adapt store-specific queries¤
Queries that use SPARQL extensions of the source store do not run on the target store, or return different results.
The most common case is full-text search, for example bif:contains in Virtuoso or the Lucene connector in GraphDB.
Such queries occur in the query catalog, in SHACL shapes, in the workspace configuration and in SPARQL tasks of Build projects.
-
Find catalog queries that use an extension with the
regexfilter, which matches the query text: -
Rewrite each query for the target store.
-
Compare the execution times on both deployments with
cmemc query replay, to find queries that run noticeably slower on the target store. A replay file lists the queries to run, see query replay. Queries with placeholders fail in a replay, becausequery replayignores placeholders.Warning
query replayalso runs update queries. Put onlySELECTqueries into a replay file used for a comparison.
Tip
Replace a filter on a fixed list of values, such as FILTER (?x IN (...)), with a VALUES block.
Many stores evaluate a VALUES block more efficiently.