0 votes
asked in MicroStream Serialization & Communication by (220 points)
Hello,

I was wondering how one can restore from the Backup Directory, when e.g. the Database directory got deleted from outside the application ? Is there a process to follow, or will the StorageManager be able to restore from the backup ?

TIA !

1 Answer

+1 vote
answered by (3.4k points)

Hello,

Microstream does not automatically restore from the backup if the storage got deleted. If the configured storage directory does not exist any more or it is empty Microstream will create a new storage at that locations.

Please not that Microstream currently does not recognize the case that a backup is existing, while the storage directory is empty. Therefore, you should check that in your application code before starting the Microstream instance to prevent the creation of a new storage that will also affect the backup.

 

The backup in the backup directory is identical to the original storage. So, you can just copy its content to the original storage’s location. This must include:

  • The type-dictionary File (by default: PersistenceTypeDictionary.ptd)
  • On directory for each configured channel (channel_0, channel_1, etc.)

The process the would be:

  1. Stop running Microstream instances
  2. Copy the content from the backup to the original location
  3. Start Microstream again
commented by (220 points)
Hello Harald,

Thanks for the clear answer. I've tried this and it works... so perfect.

Related to this: suppose one has the database local, and the backup on e.g. Google Drive. For some reason, e.g. internet connection lost, the backup gets out of sync with the database. Is Microstream able to synchronize the backup again ?

Thanks !
commented by (3.4k points)
Microstream will throw an exception in case a backup can’t be written and stop. On the next startup the backup will be synchronized with the storage. If the backup directory can’t be accessed during that startup Microstream will also stop. If the backup directory is empty a full backup of the storage without the PersistenceTypeDictionary.ptd file is done. In this case the PersistenceTypeDictionary.ptd should be copied manually to the backup folder.
Notes: Every question must be a separate forum post. Headline: Formulate your question shortly and precisely. Thank you!
Powered by Question2Answer
...