http://DatabaseSynchronizer.CodePlex.Com
Version – 1.0
Release Date for first version – June 27th, 2011

About

The Database synchronizer is a tool used to synch up different databases based on DDL and DML created by developers.

If, in a project, every change made to the database in scripted and maintained, the Database Synchronizer can be used to synch-up different databases like development database / local developer’s database, staging/production databases etc.

All the Database Synchronizer needs is the connection string to the target database, the one that it needs to update, along with path of the folder where the scripts are located. All that is needed is to make sure all the latest scripts are in the scripts’ folder and run the Database Synchronizer.

The Database Synchronizer can also be used to move the database changes (schema or data via scripts file) to any staging, testing or production environments.

The current version 1.0.0.0 supports Microsoft SQL server (any version) databases only.

For any questions / bugs / queries, please go to http://databasesynchronizer.codeplex.com/discussions.

 

Usage instructions

The video instructions are also available on the CodePlex Site - http://databasesynchronizer.codeplex.com/

Script File Naming convention:

Since the Database Synchronizer tracks database changes on the basis of script files, it is required that a fitting naming convention should be followed for the script files. The expected file name is –

<Patch # (int)>.<description (text)>.sql

The Patch number should be a unique integer value to identify the script file. Also keep in mind that the Database Synchronizer updates the database in does in the ascending order.

All the files must end with the .sql extension. Any other file extension will be ignored by the database synchronizer.

The description section is not relevant for database synchronizer however a relevant description always helps the developers to understand the purpose of the script.

Valid file names –

12.Add New Column Zip To Customer Table.sql

0003.create_user_table.SQL

32._ t.e.s.t … _.sql

Although the third file name is against any practices and hopefully no one is using such file names, but it is valid for the purpose of the Database Synchronizer.

Install:

Download the DatabaseSynchronizer_Setup.msi from http://databasesynchronizer.codeplex.com and run it to launch installer. The installer will run through the basic steps and install the application on your machine.

First time Setup:

After the installation launch the Database Synchronizer and click on the Settings button.

Click on the Edit button to make the connection string textbox editable, enter the connection sting to the database you need to update and click on Done. Make sure the user Id you are using in the connection string has the right access to make schema changes. The connecting string is stored by the Database Synchronizer in the installation folder but in encrypted format. You have the option to delete the settings which will delete the file that contains connection string and local path information.

Click on Select folder to select the folder when your SQL scripts will be located.

Click on Save. If you have not used the Database Synchronizer on this Database yet, the tool will ask you if it can go create a table in the target database to track changes made to the database.

On clicking yes, the Database synchronizer will create a table - [SchemaChange], in the target database to keep a track of the scripts that are already executed on the database. In this required for the database Synchronizer to operate.
Updating database:

To update the database, start the tool, verify the database server/instance you are using (check the checkbox). The database synchronizer will prompt you if there are any new scripts in the folder which are not executed on your database yet. When you click on Update Database Script, the Database Synchronizer will execute these scripts on the target database.

You can additionally look at the Grid View to see the details of the script files and select which ones to execute.

Each script file is treated as one transaction by the Database Synchronizer.

In case a particular script gives and error the execution stops at the script. So say 4 new scripts are found and there was an error encountered while executing the 3rd script, the 4th script will not be run.

Updating scripts for which the Database object already exists:

Imagine you are as a developer created a new table in your local database. Then, you extracted/created the create table script and put it the scripts’ folder. Now when you update the database you do not want this script to be executed on your local database as the table is already there.

In this case, use the “Update scripts I created” button and select the script file that you do not want to be executed. Once you select the script the Database Synchronizer will check and tell you in case if this script is already executed / updated to the database.

Last edited Jun 21, 2011 at 10:02 PM by MayankSri, version 2

Comments

No comments yet.