jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joel Feenstra <jrfee...@gmail.com>
Subject Jackrabbit export/import
Date Thu, 28 Oct 2010 15:27:06 GMT
Hello,

We need to migrate a repository from a file system based data store to
a database back store. I've been looking at the xml export/import
support. I am able to successfully export and import data in the
default workspace, but I am receiving an exception while importing to
the security workspace:

Caught: javax.jcr.ItemExistsException: /jcr:system

My export/import workflow is based off the following Day support document:
http://wiki.exoplatform.org/xwiki/bin/view/JCR/Migration%20to%201_7

For export its basically:

BufferedOutputStream bufferedOutputStream = new
BufferedOutputStream(new FileOutputStream(file));
session.exportSystemView(session.getNode(path).getPath(),
bufferedOutputStream, false, false);
bufferedOutputStream.close();


Where path is one of the children of the root node. Not the root
because I read that can be problematic.

The import is basically:

BufferedInputStream bufferedInputStream = new BufferedInputStream(new
FileInputStream(file));
session.getWorkspace().importXML("/",
    bufferedInputStream,
    ImportUUIDBehavior.IMPORT_UUID_COLLISION_REMOVE_EXISTING);


I have also tried it on the session directly, but that wasn't even
working for the default workspace.

Is there a better way to migrate the data? We need to retain all the
version history, shared sets, users, etc.

Is there a way to resolve the ItemExistsException? I have tried
deleting that node, but then I get constraint violations.

Any help is greatly appreciated.

- Joel

Mime
View raw message