if (!existing.contains(name)) {
target.createWorkspace(name);
}
// Copy all the workspace content
PersistenceCopier copier = new PersistenceCopier(
source.getWorkspaceInfo(name).getPersistenceManager(),
target.getWorkspaceInfo(name).getPersistenceManager(),
target.getDataStore());
copier.excludeNode(RepositoryImpl.SYSTEM_ROOT_NODE_ID);
copier.copy(RepositoryImpl.ROOT_NODE_ID);
// Copy all the active open-scoped locks
LockManagerImpl sourceLockManager = source.getLockManager(name);
LockManagerImpl targetLockManager = target.getLockManager(name);
targetLockManager.copyOpenScopedLocksFrom(sourceLockManager);