Este contenido no está disponible en el idioma seleccionado.

Chapter 1. Migrating your data


Use Red Hat JBoss Data Virtualization's backup and restore functionality to migrate the data stored in your hierarchical database. Each backup you create will contain all of the content for all of the workspaces in a single repository. Therefore, you will need to back up and restore each of your repositories one by one.
The backup and restore functionality is provided by the org.modeshape.jcr.api.RepositoryManager interface:
public interface RepositoryManager {

    ...

    Problems backupRepository( File backupDirectory ) throws RepositoryException;

    ...

    Problems restoreRepository( File backupDirectory ) throws RepositoryException;

    ...

}
Copy to Clipboard Toggle word wrap
Run this code in an Apache Jackrabbit (JCR) session in any workspace to access the repository manager:
javax.jcr.Repository repository = ...
javax.jcr.Credentials credentials = ...
String workspaceName = ...
javax.jcr.Session session = repository.login(credentials,workspaceName);
org.modeshape.jcr.api.Session msSession = (org.modeshape.jcr.api.Session)session;
org.modeshape.jcr.api.RepositoryManager repoMgr = ((org.modeshape.jcr.api.Session)session).getWorkspace().getRepositoryManager();
Copy to Clipboard Toggle word wrap

1.1. Back up your repository

Use the backupRepository method provided by the org.modeshape.jcr.api.RepositoryManager interface to back up your repository. All of the workspaces that existed when the back up was initiated will be saved. If you call the backup method on a repository that is in use, all of the changes made while the backup process is underway are also saved.

Note

The method blocks other calls until the backup is completed, so you must invoke the method asynchronously to avoid disruptions.
Each backup is stored on the file system in a series of Gzip archives. A sub-directory for storing large binaries is also created.
  • To back up your repository, run this code in your Apache JCR session:
    org.modeshape.jcr.api.RepositoryManager repoMgr = ...
    java.io.File backupDirectory = ...
    Problems problems = repoMgr.backupRepository(backupDirectory);
    if ( problems.hasProblems() ) {
        System.out.println("Problems restoring the repository:");
        // Report the problems (we'll just print them out) ...
        for ( Problem problem : problems ) {
           System.out.println(problem);
        }
    } else {
        System.out.println("The backup was successful");
    }
    Copy to Clipboard Toggle word wrap

Note

You must initiate each operation. There is no way to automatically schedule a backup.
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat