Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Archived:Enabling backup and restore for installed C++ applications

From Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Article Metadata
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Created: User:Technical writer 1 (14 Sep 2007)
Last edited: hamishwillee (29 Jun 2012)


In S60 3rd Edition, installed applications will not be backed up by default. 3rd party application developers need to enable backup and restore for their applications by including a backup_registration.xml file in the application's private directory.


A backup registration file typically includes the following information:

  1. For passive data backup operations, a list of private directories and files that should be backed up. It is possible to list a directory for backup and then list subdirectories or files that should be excluded. These directories and files are defined relative to the process private area, so it is not possible to refer to private files owned by another process (a single backslash denotes the whole private directory). If some files or directories do not exist, no error will be raised; that is, it is acceptable to list directories which do not exist yet. If an incremental backup is inefficient for the data, it is possible to specify that only base backups should be done. For example, if the data owner stores all data in one database file, an increment will always be the whole database file. In this case it is more efficient to always do a base backup or the restore involves transferring large amounts of redundant data.
  2. A list of public files and directories to be backed up as part of a partial backup. The same syntax is used as for private files but with regard to the public part of the filing system. Any system or private files are ignored from this section (because they are not public files). As with files listed for passive backup, the list can include directories that do not yet exist.

The following is an example of a backup registration file for a data owner that requires passive backup of all its files and system files ( \private\<UID>\):

   <?xml version="1.0" standalone="yes"?> 
       <include_directory name = "\" /> 
     <restore requires_reboot = "no"/> 

The above code can be used as a default template for applications that store files only under the \private directory structure.

If an application wants to store data which is accessed by another application, the data should be stored in the C:\Data directory. This directory will be automatically backed up and doesn't need to be defined in the backup registration file. However, if the application wants to backup other public directories, they should be defined using the <public_backup> tag.

For example, the following registration file defines two additional public directories that need to be backed up:

   <?xml version="1.0" standalone="yes" ?>
       <include_directory name="\" />
       <include_directory name="c:\cities\" />
       <include_directory name="e:\cities\" />
     <system_backup />
     <restore requires_reboot="no" />

Active backup

If the application requires more control over the files that are backed up and restored, it can register for active backup. The secure backup engine will start any process registered for active backup, if it's not already running. It is the application's responsibility to react to backup and restore events, and actively provide its private data to or receive it from the secure backup engine.

For more information, see:

Related articles

This page was last modified on 29 June 2012, at 06:00.
45 page views in the last 30 days.