Securely Backup & Restore Your Chat
Backup your chat#
Whenever you need to backup your chat messages, you can use the below method to start backup.
The method will backup all the chats and writes to a file. Once backup completed you can get the
backup file path from the Mirrorfly.onBackupSuccess event listeners.
| Argument | Type | Description |
|---|---|---|
| enableEncryption | bool | Specifies whether the backup data should be encrypted or not. |
Cancel Backup#
while the backup is running, if you want to cancel the backup you can use the below method
Note: Backup related events are observed through event listeners. check the event listeners details here.
Restore from a backup file#
Whenever you need to restore the chat messages from the backup file, you can use the below method.
| Argument | Type | Description |
|---|---|---|
| backupFilePath | String | backup file path. |
Cancel Restore#
while the restore backup is running, if you want to cancel the restore operation you can use the below method
Note: Depending on the chat messages size the above methods may take long time for completion.
Note: Restore related events are observed through event listeners. check the event listeners details here.
info
Cancelling restore operation will lead to partial db data, so avoid cancelling restore operation in most scenarios.