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

Create a free website or blog at WordPress.com.