Irfan's World

February 5, 2011

Distribute a System DSN to other machines in your environment

Filed under: Administration — Tags: , , , , , — Irfan @ 6:54 pm

If you are working in network services or doing a kind of administration work using Windows based systems, some times you may come across this kind of work, where it involves setting up new ODBC system DSN’s for a group of 5 or more developer’s to connect to servers, and where the environment is huge with different database servers to connect, develop, test their development.  It really becomes tedious to go to every developer’s machine and do the ODBC setups.    There is a quicker way to move the DSNs by hacking the registry, and transfer all the ODBC’s from machine A to machine B

Note : First take the backup of the registry and save it and keep it in a safe place (on a thumb drive or on network drive).  This is important because even if your system crashes you can restore the ODBC’s from this file.

Following are some of the steps that I have outlined to take the ODBC’s on one machine and transfer to other.

Go to machine A and do this:

     Go to Start menu on machine A.
     Click ‘Run’ or open a command prompt window.
     Enter regedit and then press enter, it will open the registry window
     Go to the following system registry key path and select it.
     HKEY_LOCAL_MACHINE\SOFTWARE\ODBC                                                 (this is where all the ODBC DSN’s are saved)
    
Now, Go to File –> click Export.                                                                     (export Registry File window opens)
     Enter a filename ‘allodbc.reg’ and save the file                                                  (on a Network location, say for instance N:\ODBC )

Go to machine B and do this:

      Go to Start menu on machine B.
     Click ‘Run’ or open a command prompt window.
     Enter regedit and then press enter, it will open the registry window
     Go to the following system registry path and highlight it:
    
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC
     Go to File –> click Import.                                                                               (import Registry File window opens)
    
Select the System registry file ‘allodbc.reg’ that you exported to N:\ODBC (or get it from your location) and Click Import.

You will now see all the ODBC DSNs from the machine A when you go to Start –> Settings –> Control Panel  -> Administrative Tools –> Data Sources (ODBC).   Talk to the hand

Advertisements

2 Comments »

  1. Hi ,
    I tried exporting from one machine and importing it to another however newly added DSN doesnt appear in ODBC administrator under system DSN.Is there anything else needs to be done?

    Comment by yogita — November 15, 2011 @ 11:32 pm

    • Hi,
      Make sure you have enough privileges to change/update registry.

      Comment by Irfan — November 16, 2011 @ 10:03 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: