Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2584

Binaries lost when creating a new backup of a restored repository

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 5.0.0.Final
    • 4.6.0.Final
    • JCR, Storage
    • None
    • Hide
      1. Create a repository, load binary data in a field.
      2. Create a backup
      3. Restore the repository from the backup.
      4. Create a new backup

      The zip file of the second backup does not contains the binaries.

      The following test method can be added to class RepositoryBackupAndRestoreTest to reproduce the bug

          @Test
          public void shouldPreserveBinariesFronARestoredBackup() throws Exception {
              loadBinaryContent();
              makeBackup();
              wipeRepository();
      
              startFromBackup();
              makeBackup();
              wipeRepository();
      
              startFromBackup();
              makeBackup();
          }
      
          private void makeBackup() throws RepositoryException {
              assertTrue(FileUtil.delete(backupDirectory));
              JcrSession session = repository().login();
              Problems problems = session.getWorkspace().getRepositoryManager().backupRepository(backupDirectory,
                      BackupOptions.DEFAULT);
              assertNoProblems(problems);
              session.logout();
          }
      
          private void wipeRepository() {
              // shutdown the repo and remove all repo data (stored on disk)
              repository().doShutdown(false);
              assertTrue(FileUtil.delete(backupRepoDir));
          }
      
          private void startFromBackup() throws Exception {
              startRepositoryWithConfiguration(resourceStream("config/backup-repo-config.json"));
              JcrSession session = repository().login();
              Problems problems = session.getWorkspace().getRepositoryManager().restoreRepository(backupDirectory);
              assertNoProblems(problems);
              session.logout();
      
              assertFilesInWorkspcae("default");
              assertFilesInWorkspcae("ws2");
              assertFilesInWorkspcae("ws3");
          }
      
      
      Show
      Create a repository, load binary data in a field. Create a backup Restore the repository from the backup. Create a new backup The zip file of the second backup does not contains the binaries. The following test method can be added to class RepositoryBackupAndRestoreTest to reproduce the bug @Test public void shouldPreserveBinariesFronARestoredBackup() throws Exception { loadBinaryContent(); makeBackup(); wipeRepository(); startFromBackup(); makeBackup(); wipeRepository(); startFromBackup(); makeBackup(); } private void makeBackup() throws RepositoryException { assertTrue(FileUtil.delete(backupDirectory)); JcrSession session = repository().login(); Problems problems = session.getWorkspace().getRepositoryManager().backupRepository(backupDirectory, BackupOptions.DEFAULT); assertNoProblems(problems); session.logout(); } private void wipeRepository() { // shutdown the repo and remove all repo data (stored on disk) repository().doShutdown( false ); assertTrue(FileUtil.delete(backupRepoDir)); } private void startFromBackup() throws Exception { startRepositoryWithConfiguration(resourceStream( "config/backup-repo-config.json" )); JcrSession session = repository().login(); Problems problems = session.getWorkspace().getRepositoryManager().restoreRepository(backupDirectory); assertNoProblems(problems); session.logout(); assertFilesInWorkspcae( " default " ); assertFilesInWorkspcae( "ws2" ); assertFilesInWorkspcae( "ws3" ); }

    Description

      When a repository is restored from a backup, making a new backup of it results in a zip file where no binaries are included.

      Attachments

        Activity

          People

            hchiorean Horia Chiorean (Inactive)
            salvatore.privitera Salvatore Privitera (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: