Help
database synchronize

SyncTables consists of 2 programs.

  • A Graphical User Interface (GUI) which assists in creating an XML file with all configurationdata for copying or synchronizing database tables. This program is called SyncTables_gui.exe.
  • A commandline program which does the actual copying or synchronizing of the database tables. This program reads the XML file created by the GUI. This program is called SyncTables.exe.
    Technical gurus can edit the XML file directly.

Graphical User Interface

The graphical User Interface program (SyncTables_gui.exe) is a wizard which helps you in 6 easy steps to enter the configuration data required for copying/synchronizing.

Wizard – step 1 - Sessionfile

You can open an existing configuration sessionfile or create a new empty configuration sessionfile.

 

Wizard – step 2 – Databases

Select your source and destination databases. For different databases different configuration data is required. For a database on the same computer use “localhost” as Host. You don’t have to fill in the Port when the standard Port is used.

When connecting to a MySQL database on a webhoster server then choose “MySQL + http-tunnel” as database. Upload the PHP file “synctables.php” from the program directory to your webhost and write the URL of this file in the inputfield. The protocols http and https can both be used. With https a self-signed certificate can be used.

The data in the source table is safe! This program never writes anything to the source database.

Options:

For the destination database Foreign Key checking can be turned off during insert. This is advisable when tables in your database depend on some of the tables transferred in this session.

 

Wizard – step 3 – Tables

On the left part of the screen all tables of the source database are shown. After selecting a table you can choose the copy/sync-mode with the pulldown on the right part of the screen.

Copy: All records from the table are copied from source to destination. To minimise the time that the data is not available on the destination database a temporary table is created first on the destination database. This temporary table is filled with data from the source database. At the end the table is renamed to the correct name. Tables that are configured for copying have a red flag before the tablename.

One-Way-Sync: Only records that changed since the last synchronization are transferred from source to destination. To determine these records a column with the last-modified datetime is necessary in the source table. The name of this column is selected in a pulldown. There are 2 additional options:

-         “Delete records that are in destination but not in source”
Should records that are in the destination database but not in the source database be deleted after synchronizing? The synchronizing process takes longer when this option is turned on.

-         “Do copy complete on SQL-error for insert or update”
When this option is turned on and there is an SQL-error during synchronize then the whole table will be copied as in copy mode. This may be useful when the table definition of the source table has changed.

Tables that are configured for synchronizing have a green flag before the tablename.

In the licensed version the target table can have a different name than the source table.

 

Wizard – step 4 – Pre- and post-commands

On this screen database commands (SQL) can be defined that are executed in the source and target database before and after the copy/synchronize process. The SQL commands need to be in the language of the respective database.
Examples:

  • insert into user(name, age) values('myname', 30);
  • call mystoredprocedure('abc', 100);

When an http-PHP-tunnel is used also PHP-files can be included.
Example:

  • include('my_php_includefile.php');

The screen consists of 4 inputfields:

  • upper left: commands that are executed in the source database before the copy/synchronize process
  • bottom left: commands that are executed in the source database after the copy/synchronize process
  • upper right: commands that are executed in the target database before the copy/synchronize process
  • bottom right: commands that are executed in the target database after the copy/synchronize process

 

Wizard – step 5 – Options

-         “On error” …
Here can be configured if the process will stop or continue after an SQL-error.

-         “Verbose”
This option writes a lot of information for debugging into the logfile. During normal operation this option should be turned off.

-         “Enforce name compatibility”
Databases have restrictions for naming table and fieldnames. When converting from one type of database to another these restrictions can result in an error. When this option is turned on then the table or fieldname is adapted to the destination database.

-         “strip Access Ole image headers”
When an image is in an MS Access table in an OLE field then the field contains a special header which is not part of the image. When converting to a different type of database this header must be removed to be able to read the image.

-         “delete temporary tables when an error occurred”
As explained in screen 3, a temporary table is created when copying a table. When an error occurs and the process is stopped this temporary table is removed when this option is set.

 

Wizard – step 6 – Save

In this screen the sessionfile can be saved and save as a different filename. The default extension is .sync .

With the button “Execute Session Now” the session can be started. The sessionfile needs to be saved before the button is enabled.

With the button “Schedule Session Using Windows Scheduler” the session can be entered into the Windows Scheduler. With the Windows Scheduler the copy or synchronize program can be started every day, every hour and in other intervals to keep your databases synchronous.


Commandline Program

The commandline program does the real work of copying or synchronizing.

The program is called SyncTables.exe and the parameter is the .sync file to execute.

When an http-tunnel is used the PHP-file which is in the program directory must be copied to the webserver so that the URL which was entered in the GUI is correct.

Essential data is logged on screen and in a logfile with the same filename but the extension is .log .

An extended logfile with more information (e.g. for debugging) is written when in the configuration screen the option "verbose" is checked.

When an error occurs during "Copy Table" all temporary tables on the destination database are deleted when the option “delete temporary tables when an error occurred” is checked on the options page. Otherwise the temporary tables are left in the destination database. The name of these tables starts with the current date and time.

When an error occurs during "One-Way-Sync" the process is stopped when the pulldown on the options page is set to this option. Otherwise the process will continue with the next record in the table. In the latter case certain records in the destination table may not be correct.

Data in the source tables is never changed in any way by SyncTables. An error during the copy or sync process will still keep your source data safe!


Enter License Key
database synchronize

After having bought SyncTables you will receive a serial key by email. Here is described how to enter the serial key in the program.




 

imprint