{"id":566,"date":"2012-01-30T11:58:16","date_gmt":"2012-01-30T11:58:16","guid":{"rendered":"http:\/\/sccm.haas.se\/?p=566"},"modified":"2012-04-24T22:55:02","modified_gmt":"2012-04-24T22:55:02","slug":"how-to-migrate-only-one-specific-folder-with-usmt","status":"publish","type":"post","link":"https:\/\/sccm.haas.se\/?p=566","title":{"rendered":"How to migrate only one specific folder with USMT."},"content":{"rendered":"<p>I really had to scratch my head to solve this task. Maybe there&#8217;s an easier way to do this but this is how I\u00a0solved a problem with a customer that only wanted to migrate one specific folder with USMT. All their users save all their personal data on their C-drive in a folder with a common name. I&#8217;ll call\u00a0the local folder\u00a0&#8220;Personal Data&#8221; in this blog post.<\/p>\n<p>USMT is not good at opting <strong>in<\/strong> specific folders only. It&#8217;s more built to migrate everything plus that extra folder you need and\u00a0then opt out some folders or filetypes that shouldn&#8217;t be included. But how do you exclude the C-Drive and at the same time include only one folder from the same drive?<\/p>\n<p>Simply exclude C:\\ and Include the &#8220;Personal Data&#8221;-folder and use the parameter to disregard all profiles. USMT can handle an Inclusion that is part of an Exclusion\u00a0as long as the folders\u00a0are in different <em>components<\/em> in the XML-file. See below. (Look at\u00a0<a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/cc749023(WS.10).aspx#BKMK3\">this article on Technet<\/a> for more info on how USMT handles conflicts and precedence.)<\/p>\n<p>That almost works.<\/p>\n<p>It turns out USMT has some very quirky behavour. It did migrate my &#8220;Personal Data&#8221; folder but it also migrated all my *.wav default sounds in the Windows folder, some fax-coversheets and even some *.dll files that\u00a0definitely wasn&#8217;t specified by me to be included. So, the solution was to exclude three folders that USMT tried to migrate anyway. The folders that were included by USMT contrary\u00a0to my settings\u00a0where these: C:\\Program Files,\u00a0 C:\\Windows and C:\\ProgramData.<\/p>\n<p><!--more-->So\u00a0here&#8217;s what the final XML-file looks like that I use to migrate only one folder.<\/p>\n<pre>&lt;migration urlid=http:\/\/www.microsoft.com\/migration\/1.0\/migxmlext\/PersonalFiles&gt;<\/pre>\n<pre>&lt;component type=\"Documents\" context=\"System\"&gt;\r\n\u00a0 &lt;displayName&gt;Exclude entire C drive&lt;\/displayName&gt;\r\n\u00a0 &lt;role role=\"Data\"&gt;\r\n\u00a0\u00a0\u00a0 &lt;rules&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;exclude&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;objectSet&gt;\r\n\u00a0\u00a0\u00a0\u00a0 &lt;pattern type=\"File\"&gt;c:\\* [*]&lt;\/pattern&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/objectSet&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/exclude&gt;\r\n\u00a0\u00a0\u00a0 &lt;\/rules&gt;\r\n\u00a0 &lt;\/role&gt;\r\n&lt;\/component&gt;<\/pre>\n<pre>&lt;component type=\"Documents\" context=\"System\"&gt;\r\n\u00a0 &lt;displayName&gt;Migrate Personal Folder&lt;\/displayName&gt;\r\n\u00a0 &lt;role role=\"Data\"&gt;\r\n\u00a0\u00a0\u00a0 &lt;rules&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;include&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;objectSet&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;pattern type=\"File\"&gt;C:\\PersonalData\\* [*]&lt;\/pattern&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/objectSet&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/include&gt;\r\n\u00a0\u00a0\u00a0 &lt;\/rules&gt;\r\n\u00a0 &lt;\/role&gt;\r\n&lt;\/component&gt;<\/pre>\n<pre>\u00a0\u00a0 &lt;component type=\"Documents\" context=\"System\"&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;displayName&gt;Test&lt;\/displayName&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;role role=\"Data\"&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;rules&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;unconditionalExclude&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;objectSet&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;pattern type=\"File\"&gt;C:\\Program Files\\* [*]&lt;\/pattern&gt;\r\n\u00a0\u00a0\u00a0               &lt;pattern type=\"File\"&gt;C:\\Windows\\* [*]&lt;\/pattern&gt;\r\n              \u00a0\u00a0\u00a0 &lt;pattern type=\"File\"&gt;C:\\ProgramData\\* [*]&lt;\/pattern&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/objectSet&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/unconditionalExclude&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/rules&gt;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/role&gt;\r\n\u00a0\u00a0 &lt;\/component&gt;<\/pre>\n<pre>&lt;\/migration&gt;<\/pre>\n<p>I also use the following Scanstate-syntax to exclude the local and roaming user profiles and to include my custom XML-file. Note that I don&#8217;t\u00a0include any other XML-files.<\/p>\n<p><em>scanstate.exe \/listfiles:c:\\windows\\temp\\listfiles.txt \/i:c:\\USMT\\PersonalFiles.xml \/ue:*\\*<\/em><\/p>\n<p>Parameters explained:<br \/>\n\/i = Config-file to include<br \/>\n\/ue:*\\* = Exclude all local and domain users.<br \/>\nThe\u00a0commandline switch\u00a0<em>\/listfiles<\/em>\u00a0lists all files that are migrated with USMT to a logfile which is great for troubleshooting.<\/p>\n<p>\u00a0If you found this useful, please leave a comment to make me happy!<\/p>\n<p>Thanks,<br \/>\nMathias.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I really had to scratch my head to solve this task. Maybe there&#8217;s an easier way to do this but this is how I\u00a0solved a problem with a customer that only wanted to migrate one specific folder with USMT. All their users save all their personal data on their C-drive in a folder with a<\/p>\n<p class=\"text-right\"><span class=\"screen-reader-text\">Continue Reading&#8230; How to migrate only one specific folder with USMT.<\/span><a class=\"btn btn-secondary continue-reading\" href=\"https:\/\/sccm.haas.se\/?p=566\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[46,21],"_links":{"self":[{"href":"https:\/\/sccm.haas.se\/index.php?rest_route=\/wp\/v2\/posts\/566"}],"collection":[{"href":"https:\/\/sccm.haas.se\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sccm.haas.se\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sccm.haas.se\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sccm.haas.se\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=566"}],"version-history":[{"count":29,"href":"https:\/\/sccm.haas.se\/index.php?rest_route=\/wp\/v2\/posts\/566\/revisions"}],"predecessor-version":[{"id":600,"href":"https:\/\/sccm.haas.se\/index.php?rest_route=\/wp\/v2\/posts\/566\/revisions\/600"}],"wp:attachment":[{"href":"https:\/\/sccm.haas.se\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sccm.haas.se\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sccm.haas.se\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}