issue 2440
bin/restore of encrypted or signed backup requires online server instance
| | |
| | | backups |
| | | SEVERE_ERR_RESTOREDB_ERROR_DURING_BACKUP_317=An unexpected error occurred \ |
| | | while attempting to restore backup %s from %s: %s |
| | | SEVERE_ERR_RESTOREDB_ENCRYPT_OR_SIGN_REQUIRES_ONLINE_318=Restoring an \ |
| | | encrypted or signed backup requires a connection to an online server |
| | | SEVERE_ERR_BACKUPDB_ENCRYPT_OR_SIGN_REQUIRES_ONLINE_325=The use of the \ |
| | | %s argument or the %s argument requires a connection to an online server \ |
| | | instance |
| | |
| | | } |
| | | |
| | | Message message = ERR_SCHEMA_BACKUP_CANNOT_GET_CIPHER.get( |
| | | e.getMessage()); |
| | | stackTraceToSingleLineString(e)); |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | |
| | | } |
| | | catch (CryptoManager.CryptoManagerException e) |
| | | { |
| | | Message message = ERR_SCHEMA_RESTORE_CANNOT_GET_CIPHER. |
| | | get(backupFile.getPath(), e.getMessage()); |
| | | Message message = ERR_SCHEMA_RESTORE_CANNOT_GET_CIPHER.get( |
| | | backupFile.getPath(), stackTraceToSingleLineString(e)); |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | |
| | | } |
| | | |
| | | Message message = ERR_JEB_BACKUP_CANNOT_GET_CIPHER.get( |
| | | e.getMessage()); |
| | | stackTraceToSingleLineString(e)); |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | |
| | | } |
| | | |
| | | Message message = ERR_JEB_BACKUP_CANNOT_GET_CIPHER.get( |
| | | e.getMessage()); |
| | | stackTraceToSingleLineString(e)); |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | |
| | | } |
| | | |
| | | Message message = ERR_JEB_BACKUP_CANNOT_GET_CIPHER.get( |
| | | e.getMessage()); |
| | | stackTraceToSingleLineString(e)); |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | |
| | | } |
| | | |
| | | Message message = ERR_CONFIG_BACKUP_CANNOT_GET_CIPHER.get( |
| | | e.getMessage()); |
| | | stackTraceToSingleLineString(e)); |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | Message message = ERR_CONFIG_RESTORE_CANNOT_GET_CIPHER. |
| | | get(e.getMessage(), backupFile.getPath()); |
| | | Message message = ERR_CONFIG_RESTORE_CANNOT_GET_CIPHER.get( |
| | | backupFile.getPath(), stackTraceToSingleLineString(e)); |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message, e); |
| | | } |
| | |
| | | |
| | | |
| | | // If a backup ID was specified, then make sure it is valid. If none was |
| | | // provided, then choose the latest backup from the archive. |
| | | // provided, then choose the latest backup from the archive. Encrypted |
| | | // or signed backups cannot be restored to a local (offline) server |
| | | // instance. |
| | | String backupID; |
| | | { |
| | | BackupInfo backupInfo = backupDir.getLatestBackup(); |
| | | if (backupInfo == null) |
| | | { |
| | | Message message = ERR_RESTOREDB_NO_BACKUPS_IN_DIRECTORY.get( |
| | | backupDirectory.getValue()); |
| | | logError(message); |
| | | return 1; |
| | | } |
| | | backupID = backupInfo.getBackupID(); |
| | | if (backupIDString.isPresent()) |
| | | { |
| | | backupID = backupIDString.getValue(); |
| | | BackupInfo backupInfo = backupDir.getBackupInfo(backupID); |
| | | backupInfo = backupDir.getBackupInfo(backupID); |
| | | if (backupInfo == null) |
| | | { |
| | | Message message = ERR_RESTOREDB_INVALID_BACKUP_ID.get( |
| | |
| | | return 1; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | BackupInfo latestBackup = backupDir.getLatestBackup(); |
| | | if (latestBackup == null) |
| | | { |
| | | Message message = ERR_RESTOREDB_NO_BACKUPS_IN_DIRECTORY.get( |
| | | backupDirectory.getValue()); |
| | | if (backupInfo.isEncrypted() || null != backupInfo.getSignedHash()) { |
| | | Message message = ERR_RESTOREDB_ENCRYPT_OR_SIGN_REQUIRES_ONLINE.get(); |
| | | logError(message); |
| | | return 1; |
| | | } |
| | | else |
| | | { |
| | | backupID = latestBackup.getBackupID(); |
| | | } |
| | | } |
| | | |
| | | |