org.apache.jackrabbit.core
Class RepositoryCopier

java.lang.Object
  extended by org.apache.jackrabbit.core.RepositoryCopier

public class RepositoryCopier
extends Object

Tool for backing up or migrating the entire contents (workspaces, version histories, namespaces, node types, etc.) of a repository to a new repository. The target repository (if it exists) is overwritten.

No cluster journal records are written in the target repository. If the target repository is clustered, it should be the only node in the cluster.

The target repository needs to be fully reindexed after the copy operation. The static copy() methods will remove the target search index folders from their default locations to trigger automatic reindexing when the repository is next started.

Since:
Apache Jackrabbit 1.6

Constructor Summary
RepositoryCopier(RepositoryImpl source, RepositoryImpl target)
          Creates a tool for copying the full contents of the source repository to the given target repository.
 
Method Summary
 void copy()
          Copies the full content from the source to the target repository.
static void copy(File source, File target)
          Copies the contents of the repository in the given source directory to a repository in the given target directory.
static void copy(RepositoryConfig source, File target)
          Copies the contents of the repository with the given configuration to a repository in the given target directory.
static void copy(RepositoryConfig source, RepositoryConfig target)
          Copies the contents of the source repository with the given configuration to a target repository with the given configuration.
static void copy(RepositoryImpl source, File target)
          Copies the contents of the given source repository to a repository in the given target directory.
static void copy(RepositoryImpl source, RepositoryConfig target)
          Copies the contents of the given source repository to a target repository with the given configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryCopier

public RepositoryCopier(RepositoryImpl source,
                        RepositoryImpl target)
Creates a tool for copying the full contents of the source repository to the given target repository. Any existing content in the target repository will be overwritten.

Parameters:
source - source repository
target - target repository
Method Detail

copy

public static void copy(File source,
                        File target)
                 throws RepositoryException,
                        IOException
Copies the contents of the repository in the given source directory to a repository in the given target directory.

Parameters:
source - source repository directory
target - target repository directory
Throws:
RepositoryException - if the copy operation fails
IOException - if the target repository can not be initialized

copy

public static void copy(RepositoryConfig source,
                        File target)
                 throws RepositoryException,
                        IOException
Copies the contents of the repository with the given configuration to a repository in the given target directory.

Parameters:
source - source repository configuration
target - target repository directory
Throws:
RepositoryException - if the copy operation fails
IOException - if the target repository can not be initialized

copy

public static void copy(RepositoryConfig source,
                        RepositoryConfig target)
                 throws RepositoryException
Copies the contents of the source repository with the given configuration to a target repository with the given configuration.

Parameters:
source - source repository configuration
target - target repository directory
Throws:
RepositoryException - if the copy operation fails

copy

public static void copy(RepositoryImpl source,
                        File target)
                 throws RepositoryException,
                        IOException
Copies the contents of the given source repository to a repository in the given target directory.

The source repository must not be modified while the copy operation is running to avoid an inconsistent copy.

Parameters:
source - source repository directory
target - target repository directory
Throws:
RepositoryException - if the copy operation fails
IOException - if the target repository can not be initialized

copy

public static void copy(RepositoryImpl source,
                        RepositoryConfig target)
                 throws RepositoryException
Copies the contents of the given source repository to a target repository with the given configuration.

The source repository must not be modified while the copy operation is running to avoid an inconsistent copy.

Parameters:
source - source repository directory
target - target repository directory
Throws:
RepositoryException - if the copy operation fails
IOException - if the target repository can not be initialized

copy

public void copy()
          throws RepositoryException
Copies the full content from the source to the target repository.

The source repository must not be modified while the copy operation is running to avoid an inconsistent copy.

This method leaves the search indexes of the target repository in an Note that both the source and the target repository must be closed during the copy operation as this method requires exclusive access to the repositories.

Throws:
RepositoryException - if the copy operation fails


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.