Magnolia 6.0 reached end of life on June 26, 2019. This branch is no longer supported, see End-of-life policy.
This pages explains how to delete a JCR workspace on a Magnolia system.
You cannot delete a JCR workspace programmatically with Magnolia. You must delete it manually.
Apache Jackrabbit, which is the JCR implementation used by Magnolia, does not implement the #deleteWorkpace
method defined in the JCR 2.0 API (see javax.jcr.Workspace javadoc).
Before starting:
There are two main steps involved in deleting a workspace manually:
$magnolia.repositories.home/magnolia/workspaces/$workspace-name
.Delete database tables with table names containing the workspace name.
On embedded databases such as H2 you can skip step 2.
For every JCR workspace there is a folder on the file system. The value of the magnolia.repositories.home
property defines the location of these folders. Check the value for your system:
magnolia.properties
files where the property is defined.Determine the path for
$magnolia.repositories.home/magnolia/workspaces/$workspace-name
and delete the folder.
Example:
magnolia.repositories.home | /var/lib/author/tomcat/webapps/author/repositories |
Workspace name | dms |
Folder to delete | /var/lib/author/tomcat/webapps/author/repositories/magnolia/workspaces/dms |
Generally you should delete all tables which contain the JCR workspace name.
Your approach when deleting these tables depends on the persistence layer. Some examples of persistence layers are: Apache Derby, H2, Ingres, MySQL, Oracle and others. The value of the Magnolia property magnolia.repositories.jackrabbit.config
gives an indication of the persistence layer in use.
Example:
Jackrabbit persistence layer | MySQL (Version 14.14, Distribution 5.7.20, for Linux (x86_64)) |
Workspace name | dms |
Table names in MySQL DB | PM_DMS_BINVAL , PM_DMS_BUNDLE , PM_DMS_NAMES , PM_DMS_REFS |
Depending on how your Magnolia instances are set up and if you use clustering, you must delete a workspace in one or several locations.
Make sure you delete the workspace on both the author instance and on all public instances.