- 0
How can I migrate registry keys from one location on the source to another on the destination
Asked by
anyweb
Asked by
anyweb
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
if you want to migrate registry keys from one location to another (provided that they are detected) then use the following code in a custom XML file
<?xml version="1.0" encoding="UTF-8"?> <migration urlid="http://www.microsoft.com/migration/1.0/migxmlext/WNB_move_reg_keys"> <!-- WNB_move_reg_keys.xml is basically a customized version of MigUser.xml --> <_locDefinition> <_locDefault _loc="locNone"></_locDefault> <_locTag _loc="locData">displayName</_locTag> </_locDefinition> <!-- This component migrates Old Reg Keys and moves them to NEW locations provided that the key exists --> <component context="User" type="Application"> <displayName _locID="regkeymove_user">Move old reg keys to new location</displayName> <role role="Settings"> <detects> <detect> <condition>MigXmlHelper.DoesObjectExist("Registry","HKLM\SOFTWARE\CUSTOM [CUSTOMval#1]")</condition> </detect> </detects> <rules> <include> <objectSet> <pattern type="Registry">HKLM\SOFTWARE\CUSTOM [CUSTOMval#1]</pattern> <pattern type="Registry">HKLM\SOFTWARE\CUSTOM [CUSTOMval#2]</pattern> </objectSet> </include> <locationModify script="MigXmlHelper.ExactMove('HKLM\SOFTWARE\CUSTOM [PrevCUSTOMval#1]')"> <objectSet> <pattern type="Registry">HKLM\SOFTWARE\CUSTOM [CUSTOMval#1]</pattern> </objectSet> </locationModify> <locationModify script="MigXmlHelper.ExactMove('HKLM\SOFTWARE\CUSTOM [PrevCUSTOMval#2]')"> <objectSet> <pattern type="Registry">HKLM\SOFTWARE\CUSTOM [CUSTOMval#2]</pattern> </objectSet> </locationModify> </rules> </role> </component> </migration>this code checks if the following registry key exists HKLM\SOFTWARE\CUSTOM\CUSTOMval#1 and if it does, it migrates the following two registry keys from the SOURCE pc
HKLM\SOFTWARE\CUSTOM\CUSTOMval#1
HKLM\SOFTWARE\CUSTOM\CUSTOMval#2
to the following locations on the DESTINATION pc
HKLM\SOFTWARE\CUSTOM\PrevCUSTOMval#1
HKLM\SOFTWARE\CUSTOM\PrevCUSTOMval#2
Note: if you are using a 64 bit OS with a 32bit application (X86) that you'll probably want to change the path statements
for example, change
to
cheers
niall
Share this post
Link to post
Share on other sites