Synchronizing databases
Synchronizing databases, uploads the data from the database subset to the main database and downloads new and updated records in the subset definition to the database subset. You can update the database subset using the original subset definition or you can select a different subset definition.
About this task
A conflict occurs when an entity or link is changed in both the main database and the database subset. To resolve the conflict, you need to decide which record you want to keep. You can select:
Discard the subset record changes - this means you keep the changes to the record in the main database and lose the information in the record from the database subset.
Keep the subset record changes - this means you keep the information in the record in the database subset and overwrite the changes that are made to the record in the main database.
If the main record is deleted, then it is:
Restored and updated to match the subset record if Soft Delete is in use.
Re-created if the record is deleted or purged.
Restoring or re-creating a link always results in the link ends being restored or re-created if necessary. Restoring or re-creating an entity also restores or re-creates any associated links if the other end of the link is still active.
During synchronization, the following error messages might be displayed:
The database subset has expired. - You cannot reuse an expired database subset. Re-create it from its database subset definition.
The database subset has an incompatible schema. - The database subset is invalid because the schema of the main database was changed after the database subset was created. To fix this problem, use the Database Schema Update option in iBase Designer.
The database subset is read-only. - Use iBase Designer to change the database properties of the database subset so that it is no longer read-only. Although you can change the Read-only property in an expired database, you cannot reuse it.
This is not a valid database subset. - The selected database subset is either not a database subset or it might be a subset of a different database. You can set the database subset to expire if you do not need it any longer. This deletes the contents of the database subset and mark it as read-only. The database subset can never be reused.
When you synchronize a database subset with the main database:
Newly created entities and links in the database subset are added to the main database, with the same record identifier, create date or time, and create user.
All (soft) deleted records in the database subset are ignored - they have no effect on the main database.
Records in the main database are updated to match the changes in the database subset if there are no conflicts.
If a record has changed in both the main database and database subset, since the last synchronization, then conflict resolution is applied. See below for details.
At the end of synchronization, you are informed of the changes made to the main database:
The number of new records added to the main database.
The number of records updated in the main database with changes made in the database subset
If Soft Delete is used: the number of records restored as a result of conflict resolution
If Soft Delete is not used: the number of records that are re-created as a result of conflict resolution
The total number of conflicts resolved (at record level)
When synchronization is complete, an updated database subset, re-created using the latest version of the subset definition, is available for reuse in the field. Alternatively, the database subset is set to read-only if the database subset was set to expire.
Procedure
To upload the records in a database subset:
Back up the main database if it is in Microsoft Access format.
Log on using a user account that has the Database Administrator role and permission to add records, update records, delete records, and update or delete records created by other users.
Open the database from which the database subset was created.
Select File > Data > Database Subsets > Synchronize.
Browse for the database subset containing the records that you want to load.
Log on to the subset security file as a user with system administrator permissions. Typically, you will use the name and password specified when the subset security file and database was created.
Click Connect.
Decide what you want to do with the database subset:
To discard the subset after uploading the records to the main database, turn on The database subset should expire after synchronization.
To reuse the subset, browse for a subset definition (it does not have to be the original subset definition).
Note: The Subset Definition box displays the name of the subset definition originally used to create the subset, and will be blank if the subset definition is no longer accessible or does not exist.
Decide how you want to handle any conflicts between changes made in the main database and those made in the database subset. By default, the dialog ensures that the synchronization will never overwrite changes in the main database.
Note: At this stage it is not possible to know whether there are actually any conflicts.
Click Synchronize and then OK to continue. If the subset definition contains any parameterized queries then you will be prompted for the values to use. If you cancel entry of the parameter values, you will also cancel the synchronization of the databases.