Jump to content

Sign in to follow this  

How can I migrate registry keys from one location on the source to another on the destination

Recommended Posts

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 -->
 <_locDefault _loc="locNone"></_locDefault>
 <_locTag _loc="locData">displayName</_locTag>

<!-- 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">
<condition>MigXmlHelper.DoesObjectExist("Registry","HKLM\SOFTWARE\CUSTOM [CUSTOMval#1]")</condition>
 	<pattern type="Registry">HKLM\SOFTWARE\CUSTOM [CUSTOMval#1]</pattern>
 	<pattern type="Registry">HKLM\SOFTWARE\CUSTOM [CUSTOMval#2]</pattern>
<locationModify script="MigXmlHelper.ExactMove('HKLM\SOFTWARE\CUSTOM [PrevCUSTOMval#1]')">
 	<pattern type="Registry">HKLM\SOFTWARE\CUSTOM [CUSTOMval#1]</pattern>
<locationModify script="MigXmlHelper.ExactMove('HKLM\SOFTWARE\CUSTOM [PrevCUSTOMval#2]')">
 	<pattern type="Registry">HKLM\SOFTWARE\CUSTOM [CUSTOMval#2]</pattern>


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





to the following locations on the DESTINATION pc





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










Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...