One-Way Sync - Omega Sync, SQL database comparison and synchronization

One-Way Sync Tutorial


Purpose of this tutorial is to show you basic use of Data Sync. In the first tutorial we showed how to compare two databases. We will now synchronize the changes, so that work database equals reference database. Reference database will not be changed. If we wish to partially change reference, and partialy work database, we need to use Two-Way Sync mode instead.

First, we converted the standard Microsoft Northwind database from SQL Server to MySQL. We used our own state-of-the-art database converter for that.
We compared SQL Server database with our MySQL database and they were equal, proving that our Full Convert did its task perfectly. We then manually made some differences. For details about all that, look at our database comparison tutorial.

Let's continue from that point and sync the databases. Here is a breakdown of what we'll do:
  1. Edit our project project and change the mode from Comparison to One-Way Sync (this will enable us to change work database, but not reference database)
  2. Compare our databases
  3. Review differences
  4. Synchronize
  5. Recompare to make sure our databases are equal

Edit project

As we already have the comparison project open from the comparison tutorial, we will simply edit the project and change the project mode from Comparison to One-Way Sync.

One-Way Synchronization project

Compare

Finishing the project wizard starts the comparison right away.
Comparison result
As expected, we see the same differences as when we compared the databases before, but the table showing what's different is slightly different now. We can deselect tables we don't want synchronized now, and we can click on any table name to explore the data differences in detail. Also, there are two new columns on the right showing us how many synchronization SQL commands are generated for each database (reference and work) with our current settings. As this is one-way synchronization project, reference database will never be touched.

Review differences

Let's explore the differences for each table.
Clicking on the Categories table name opens a grid showing the detailed info of the table differences. We have quite innovative user interface here, making it very easy to navigate the table.

Categories table

Categories diff

Customers table

Customers diff
Table rows are grouped by two. Upper row is always data in the reference database, and lower in the work database. Field values equal in both databases are merged. NULL values are displayed with hatch background so you can easily distinguish them from empty string or spaces.
Action column displays direction of sync for the row. In One-Way mode, it will show down arrow (meaning work database is updated), or a cross (meaning this row is excluded from sync and will be skipped). You can see that each field with difference has a small button, enabling you to skip specific values, while still synchronizing the rest of the database record. That's some control!

Synchronize

Clicking the Synchronize button in the ribbon will not start the sync process immediately. Instead, we can review the commands and confirm we want to sync.
Synchronization dialog
Before actually synchronizing, we can click on the Show SQL link to examine the SQL we'll run against the work database.

Generated SQL commands

Data Sync SQL commands
OK, let's finally click the Synchronize button so Data Sync can do the magic! A single click, and after a few seconds we see that data was synchronized and we're done.
Synch result

Recompare

So, did Data Sync synchronize the tables properly? A single click on the Recompare button will tell.
And, the result is... Databases are equal! Nice.
Equal databases

That's all for this one-way sync tutorial. Let's continue to the Two-Way Sync tutorial.

We invite you to explore Data Sync more, and, of course, to purchase it. If you want to test it yourself, just download a free trial.

Buy NowFree Trial


Learn more about Data Sync
Spectral Core Chat

Current version

ReleaseJuly 13, 2010
Omega Sync 2.8 released
To see detailed version history of this application, click here.