How to delete a JCR workspace

This page explains how to delete a JCR workspace on a Magnolia system.

JCR API and Jackrabbit

You cannot delete a JCR workspace programmatically with Magnolia. You must delete it manually.

Apache Jackrabbit, which is the JCR implementation used by Magnolia, doesn’t implement the #deleteWorkpace method defined in the JCR 2.0 API (see javax.jcr.Workspace).

public void deleteWorkspace(String name) throws AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException {
  throw new UnsupportedRepositoryOperationException("not yet implemented");

Deleting a workspace manually

Before starting:

  • Note that deletion cannot be reverted.

  • Ensure that the workspace you want to delete doesn’t contain content you still require.

  • Shut down the application server (such as Tomcat) before manually deleting. You can’t delete a workspace on a running system.


There are two main steps involved in deleting a workspace manually:

  1. Delete the folder $magnolia.repositories.home/magnolia/workspaces/$workspace-name.

  2. Delete database tables with table names containing the workspace name.

On embedded databases such as H2, you can skip step 2.

Deleting the workspace folder in the repository folder

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.

  1. Check the value for your system:

    1. If your system is still running, use the About app to look up the property.

    2. Alternatively, check the files where the property is defined.

  2. Determine the path for $magnolia.repositories.home/magnolia/workspaces/$workspace-name and delete the folder.

Table 1. Example



Workspace name


Folder to delete


Deleting database tables

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:

The value of the Magnolia property magnolia.repositories.jackrabbit.config gives an indication of the persistence layer in use.

Table 2. Example

Jackrabbit persistence layer

MySQL (Version 14.14, Distribution 5.7.20, for Linux (x86_64))

Workspace name


Table names in MySQL DB


Multiple instances and clustering

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.

DX Core



This widget lets you know where you are on the docs site.

You are currently perusing through the DX Core docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules
6.3 beta

Magnolia 6.3 beta

Magnolia 6.3 is in beta. We are updating docs based on development and feedback. Consider the 6.3 docs currently in a state of progress and not final.

We are working on some 6.3-beta known issues during this phase.