# Differences between remote and master databases

This window is displayed by clicking on the Differences between databases option in the Transfers menu

This is an advanced option used to find and fix any differences between a remote database and the master database.

It is likely to be run only by the database administrator and infrequently. Usually an obvious problem with a particular site’s database is the trigger for using this option.

In order to use this option some or all of the tables (and their associated indexes) in the data directory of the remote site must be sent to the master site. Normally the entire data directory is zipped and emailed, even though this can be a large file. Ideally a data transfer will have been completed before the file is sent and no changes will have been made on the master site since the transfer.

If there have been no problems then the 2 databases would be equal. However, even the best schemes are not foolproof and from time to time the databases may get out of step.

The table is used to view and process any differences detected by the 2 databases.

This table can be sorted by Site, table and key or by table, key and site by clicking on the [A/Z] button. Normally the table itself is not processed directly.

1. Click "▲" to open an existing record to edit, and "-" to delete a record. Records are added using the Detect differences option.

2. The key information is read only. The user can only edit the Action and the Completed fields.
The site code indicates which site was compared

3. The table name and key values are given for records that differ.

4. The status is one of the following
D – the record existing in both databases but has different values.
M – The record exists in the remote database but is missing from the Master
R – The record exists in the master database but is missing from the Remote.

5. The Action to be taken is one of the following
R – import the value from the Remote into the Master.
M – Add the master value to the master export list to export to the remote in the next transfer. This will also Delete a missing record in the master from the remote.
D – Delete the record from the Master.
I – Ignore the record.

6. Once the action has been processed the completed checkbox will be ticked. The records can then be cleared.

7. [Detect differences] is used to check the 2 databases (or a selection of tables in them) and will populate the table with the differences detected.

8. [Compare] is used to look at the values of the same record in each database to see what difference exist and to indicate the action to be taken.

9. [Clear inactive sites] removes any records in the table that relate to sites that are not active.

10. [Clear completed] removes records that have been processed.

11. [Clear site] Clears records for a selected site only.

12. [Process Differences] will process the Action for records that are not completed, importing, exporting or deleting as required for a selected site.

# Detect differences in databases

This window is displayed by clicking on the Detect differences button on the Differences between databases option.

This form is modal. You must close it before you can access other forms or the menu

1. Select the remote database to compare. The data files from that remote site should be copied to a subdirectory called Data under the site database , eg C:\IDW\RIGA\DATA

2. Select the tables to compare from the lest lists and move them to the right list. (see dual lists in the user guide). Often a single click on the [>>] key is all that is required if all tables are to be compared.

3. Click OK to process.

4. The progress bar will c\display the operation occurring and its progress

5. The program processes each table check first for records in the remote that aren’t in the master, then vice versa and then where the two are different. As each table is processed the number of differences detected is written in the right list.

The actual records will now be added to the difference table.

# Compare Differences

This window is displayed by clicking on the Compare button on the Difference between Databases screen.

It is used to resolve differences between the records in a remote database and the master.

1. The table and key value of the record being compared is displayed.

2. The values of each field in the two databases are displayed in the grid, one line per field. The “?” column has either “=” if the fields have the same values or “<>” if they are different. In this case the Class field is the one that is different.

3. If the Master value is correct click on the [Export…] button. This will add that record to the master export list for transfer to the remote site.

4. If on the other hand the Remote value is correct, then you click on the [Import…] button. This will import the value from the other site, overwriting the master value.

5. If you are uncertain what to do you can [Ignore] the record for the time being.

6. Click [Delete] if the record is to be deleted from the master.

7. The [Prev] and [Next] buttons are used to scroll through the records.. This will happen automatically after clicking on the [Export] or [Import] buttons.

Note this procedure does not actually perform the updates, but defines the action to be taken only. The updates occur when the [Process differences] button is clicked on the edit screen.

Document RemoteDifferences.htm