Backup

Continuous Backup

By default, the continuous backup is disabled. If enabled the MicroStream instance will clone all changes to another directory. The backup is identical to the primary MicroStream storage.

To enable the continuous backup just set the backup directory:

With storage.embedded.configuration API:

Java
Xml
ini
Java
EmbeddedStorageManager storageManager = Configuration.Default()
.setBackupDirectory("A safe place")
.createEmbeddedStorageFoundation()
.createEmbeddedStorageManager();
Xml
<properties>
<property name="backupDirectory" value ="/save/backup" />
...
</properties>
ini
backupDirectory = backupDir

With MicroStream foundation classes:

Java
StorageBackupSetup backupSetup = StorageBackupSetup.New(
Storage.FileProviderBuilder()
.setBaseDirectory(BACKUPDIR.getPath())
.setTruncationDirectory(TRUNKATIONDIR.getPath())
.setDeletionDirectory(DELETIONDIR.getPath())
.createFileProvider()
);
StorageConfiguration configuration = StorageConfiguration.Builder()
.setBackupSetup(backupSetup)
.setStorageFileProvider(StorageFileProvider.New(WORKINGDIR))
.createConfiguration();

‚Äč