This repository has been archived by the owner on Jul 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Migration
Natasa Bulatovic edited this page Jul 26, 2016
·
1 revision
- **General migration procedure of imeji (Tomcat example, imeji deployed as a single application on that app server) **
- Download last version of imeji e.g. "imeji-3.4.0.0.war"
- Stop the application server where imeji is deployed e.g. stop tomcat from running
- Backup all your data
- Go to the deployment directory e.g. tomcat_home/webapp directory and remove the old imeji.war and /imeji directory (old deployment)
- Copy the downloaded file e.g. "imeji-3.4.0.0.war" to the deployment directory and rename it to "imeji.war"
- Clean-up the working and temporary directories of your app server (e.g. tomcat_home/work)
- (optional) see If the migration to release requires a SPARQL Update below
- Start the application server
IMPORTANT: Please do not do "hot" deployment as it may corrupt the Jena triple store data. For other application servers apply the same procedure with application server specific reference to the deployment, working and temporary directories.
- If the migration to release requires a SPARQL Update: The SPARQL query ( SPARQL official specifications) should be written in a file called "migration.txt". This file should be stored in the jena tdb home directory (see property 'imeji.tdb.path' in the imeji.properties file). The content of this file will be reported on this page for the migration when needed.
- If you want to test migration from another imeji instance: to have a consistent copy of the Jena tdb home directory, imeji instance has to be offline (no process should access it)
Make sure you perform previous migration steps first (SPARQL Updates) This migration does not include any SPARQL updates, however, it is necessary to build the elastic index after you start your imeji instance.
- Login with Administrator permissions, seems this kind of migration resets the admin account, we will check this.. (if old admin account is reset you need to use [email protected]/admin)
- Go to ADMIN->Storage Administration->Tools
- Scroll to "Search" group and click "reindex" button
WITH <http://imeji.org/item>
DELETE {?mds <http://imeji.org/terms/metadata> ?s}
INSERT {?mds <http://imeji.org/terms/metadata/> ?s}
USING <http://imeji.org/item>
WHERE {?mds <http://imeji.org/terms/metadata> ?s};
By version 2.0.0.0, we updated the user roles. The following migration maps the old user roles to the new ones (see mapping here)
PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
WITH <http://imeji.org/user>
DELETE {?s ?pr ?g . ?g ?p ?o}
USING <http://imeji.org/user>
USING <http://imeji.org/collection>
USING <http://imeji.org/metadataProfile>
USING <http://imeji.org/album>
WHERE {?g <http://imeji.org/terms/grantFor> ?for . not exists{?for ?prop ?obj} . filter (?for!= <http://imeji.org/> && ?for != <XXX_BASE_URI_XXX>) . ?s ?pr ?g . ?g ?p ?o};
WITH <http://imeji.org/user>
DELETE {?g <http://imeji.org/terms/grantFor> ?for
. ?g <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#SYSADMIN>}
INSERT {?g <http://imeji.org/terms/grantFor> <XXX_BASE_URI_XXX>
. ?g <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#ADMIN>}
USING <http://imeji.org/user>
WHERE {?g <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#SYSADMIN>
. ?g <http://imeji.org/terms/grantFor> ?for};
WITH <http://imeji.org/user>
DELETE {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#VIEWER>}
INSERT {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#READ>}
USING <http://imeji.org/user>
WHERE {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#VIEWER>};
WITH <http://imeji.org/user>
DELETE {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#PRIVILEGED_VIEWER>}
INSERT {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#READ>}
USING <http://imeji.org/user>
WHERE {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#PRIVILEGED_VIEWER>};
WITH <http://imeji.org/user>
DELETE {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#IMAGE_EDITOR>}
INSERT {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#READ>
. ?user <http://imeji.org/terms/grant> ?g1 . ?g1 <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#UPDATE_CONTENT> . ?g1 <http://imeji.org/terms/grantFor> ?for}
USING <http://imeji.org/user>
WHERE {?user <http://imeji.org/terms/grant> ?s
. ?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#IMAGE_EDITOR>
. ?s <http://imeji.org/terms/grantFor> ?for
. let(?g1 := uri(fn:concat('http://imeji.org/terms/grant/XXX_NEW_ID_XXX',afn:sha1sum(?for))))};
WITH <http://imeji.org/user>
DELETE {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#CONTAINER_EDITOR>}
INSERT {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#READ>
. ?user <http://imeji.org/terms/grant> ?g1 . ?g1 <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#UPDATE> . ?g1 <http://imeji.org/terms/grantFor> ?for}
USING <http://imeji.org/user>
WHERE {?user <http://imeji.org/terms/grant> ?s
. ?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#CONTAINER_EDITOR>
. ?s <http://imeji.org/terms/grantFor> ?for
. let(?g1 := uri(fn:concat('http://imeji.org/terms/grant/XXX_NEW_ID_XXX',afn:sha1sum(?for))))};
WITH <http://imeji.org/user>
DELETE {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#PROFILE_VIEWER>}
INSERT {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#READ>}
USING <http://imeji.org/user>
WHERE {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#PROFILE_VIEWER>};
WITH <http://imeji.org/user>
DELETE {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#PROFILE_EDITOR>}
INSERT {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#READ>
. ?user <http://imeji.org/terms/grant> ?g1 . ?g1 <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#UPDATE> . ?g1 <http://imeji.org/terms/grantFor> ?for}
USING <http://imeji.org/user>
WHERE {?user <http://imeji.org/terms/grant> ?s
. ?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#PROFILE_EDITOR>
. ?s <http://imeji.org/terms/grantFor> ?for
. let(?g1 := uri(fn:concat('http://imeji.org/terms/grant/XXX_NEW_ID_XXX',afn:sha1sum(?for))))};
WITH <http://imeji.org/user>
DELETE {?s <http://imeji.org/terms/grantType> <http://imeji.org/terms/grantType#PROFILE_ADMIN>}