Application data, such as the configuration and service data, is generated when an application is used. To prevent user data from being lost due to operations such as app updates and migration, the app needs to integrate data backup and restoration.
Before development, you need to understand the ExtensionAbility component.
Derived from ExtensionAbility in the stage model, BackupExtensionAbility provides the capabilities of backing up and restoring application data. It is an extended component without the UI. It runs when a backup or restore task starts and exits when the task is complete.
Application data backup and restore can be implemented in either of the following ways:
An app itself cannot trigger data backup and restore; it can only configure backup and restore. Data backup and restore are triggered in application clone and application data migration. An app only needs to support data backup and restore. For details about how to verify the integration, see Verification Guide for App Data Backup and Restore.