public class RepositoryCopier extends Object
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.
Constructor and Description |
---|
RepositoryCopier(RepositoryImpl source,
RepositoryImpl target)
Creates a tool for copying the full contents of the source repository
to the given target repository.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public RepositoryCopier(RepositoryImpl source, RepositoryImpl target)
source
- source repositorytarget
- target repositorypublic static void copy(File source, File target) throws RepositoryException, IOException
source
- source repository directorytarget
- target repository directoryRepositoryException
- if the copy operation failsIOException
- if the target repository can not be initializedpublic static void copy(RepositoryConfig source, File target) throws RepositoryException, IOException
source
- source repository configurationtarget
- target repository directoryRepositoryException
- if the copy operation failsIOException
- if the target repository can not be initializedpublic static void copy(RepositoryConfig source, RepositoryConfig target) throws RepositoryException
source
- source repository configurationtarget
- target repository directoryRepositoryException
- if the copy operation failspublic static void copy(RepositoryImpl source, File target) throws RepositoryException, IOException
The source repository must not be modified while the copy operation is running to avoid an inconsistent copy.
source
- source repository directorytarget
- target repository directoryRepositoryException
- if the copy operation failsIOException
- if the target repository can not be initializedpublic static void copy(RepositoryImpl source, RepositoryConfig target) throws RepositoryException
The source repository must not be modified while the copy operation is running to avoid an inconsistent copy.
source
- source repository directorytarget
- target repository directoryRepositoryException
- if the copy operation failspublic void copy() throws RepositoryException
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.
RepositoryException
- if the copy operation failsCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.