Skip to main content

Migration utilities

This package provide utilities to help migrate semantic data.

Dependencies

Install

$ yarn add @semapps/migration

Usage

const { MigrationService } = require('@semapps/migration');
const path = require('path');

module.exports = {
mixins: [MigrationService],
settings: {
baseUrl: 'http://localhost:3000'
}
};

Actions

The following service actions are available.

clearUserRights

  • Remove all rights associated with a user
  • Remove the user from all WebACL groups he may be member of
Parameters
PropertyTypeDefaultDescription
userUriStringrequiredURI of the user
datasetStringDefault datasetDataset where migration will be applied

moveResource

Move a resource to a new URI. Also move the WebACL rights of the resource.

Parameters
PropertyTypeDefaultDescription
oldResourceUriStringrequiredResource to move
newResourceUriStringrequiredNew URI of the resource
datasetStringDefault datasetDataset where migration will be applied

moveResourcesToContainer

Move all resources from a container to another container. Also move the WebACL rights of the resource.

Parameters
PropertyTypeDefaultDescription
oldContainerUriStringrequiredURI of container to move the resources from
newContainerUriStringrequiredURI of container where to move the resources
datasetStringDefault datasetDataset where migration will be applied

moveAclGroup

Move an ACL group to a new URI. Also move the WebACL rights of the group.

Parameters
PropertyTypeDefaultDescription
oldGroupUriStringrequiredGroup to move
newGroupUriStringrequiredNew URI of the group
datasetStringDefault datasetDataset where migration will be applied

replacePredicate

Replace an old predicate with a new predicate on the whole dataset.

Parameters
PropertyTypeDefaultDescription
oldPredicateStringrequiredFull URI of predicate to be replaced
newPredicateStringrequiredFull URI of predicate to replace with
datasetStringDefault datasetDataset where migration will be applied