Tuesday, August 11, 2009

How to import ODBC settings from 32 bit OS to 64 bit OS

Try registry import/export.

System DSN:

1. Export all entries under HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI into a file SysDsn.reg
2. Use notepad to open SysDsn.reg and replace all occurrences of "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources" with "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources"
3. Save the file and copy it to the new machine
4. Import the SysDsn.reg into the registry of the new machine

User DSN:

1. Export all entries under HKEY_CURRENT_USER\Software\ODBC\ODBC.INI into a file UserDsn.reg
2. You don't need to change the content of the reg as above for system DSN
3. Copy the file to the new machine
4. Import the UserDsn.reg into the registry of the new machine

After completed both steps, all existing applications should expect to work as before. But if some application has migrated from 32-bit to 64-bit and if it is using system DSN, you may need to move the corresponding entries from HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources. (There is no similar problem for user DSN. See a related KB for this issue at: http://support.microsoft.com/kb/942976/en-us).

However, it is not a good idea to move all entries from Wow6432Node to the Native 64-bit registry tree, since this may break some 32-bit applications running under WOW64 mode. Please also note that there is no 64-bit ODBC driver for Excel / Access available currently. Therefore, any application using Excel / Access as data source must not be upgraded to be 64-bit. For those applications, it should still be able to run under WOW64 mode.

No comments: