TheJumpCloud / jumpcloud-ADMU

JumpCloud Active Directory Migration Utility - JCADMU
23 stars 7 forks source link

Migration tries to move data outside of profile #31

Closed vankampenp closed 3 years ago

vankampenp commented 4 years ago

When using non standard locations for Desktop, Documents, Downloads and Pictures, the migration tries to move them as well. In one case there are hundreds of thousands pictures on a D drive. The migration took very long but did not seem to work (see separate Issue). Very long means several hours.

After setting the location to the default location (in c:\users\ The migration was very fast.

When the data does not reside in a profile controlled location, I would expect the migration to not take that data in to account, just migrate the profile, and have the new profile point to the same lcoation.

btstevens commented 4 years ago

Hello @vankampenp . When you say 'non standard locations' are the locations being changed within explorer or another method?

Documents example: image

We have added the ability in the tool to utilize the custom.xml within the tool. This was a first pass at allowing custom rules to achieve similar to what you discussed above and account for custom system migration scenarios.

By clicking on the checkbox 'Use Custom XML' it will take you the 'USMT Custom.XML' tab. The xml here will then be used in the migration and allows you to customize what is included or excluded in the migration steps.

image

The pre-populated custom.xml is adding an INCLUDE to also migrate 'appdata' folders. This could be useful for example where you want to migrate the google local app data and exclude the slack subfolder. This granularity can be built out to help migrate different applications.

image

the default behavior of the tool as you have seen is to INCLUDE the Desktop, Documents, Downloads etc. folders no matter where they are redirected. So in your case if you DON'T use the custom.xml it will attempt to pull D:\Photos with no exclusions and as a result take a long time if there are a lot of files.

To get around this, we can utilize the custom.xml and either exclude a location/directory or we can include a specific location/directory or even file type.

A good XML example would be:

<component type="Documents" context="System">
  <displayName>Component to migrate all user documents except Sample.doc</displayName>
  <role role="Data">
    <rules>
         <include>
            <objectSet>
                 <pattern type="File"> C:\UserDocuments\* [*]</pattern>
            </objectSet>
          </include>
        <exclude>
             <objectSet>
                 <pattern type="File"> C:\UserDocuments\ [Sample.doc]</pattern>
             </objectSet>
          </exclude>
    </rules>
  </role>
</component>

More information on the XML syntax can be found here: https://docs.microsoft.com/en-us/windows/deployment/usmt/usmt-custom-xml-examples

For your issue example if I wanted to include everything but EXCLUDE the photos directory that was redirecting to D:\Photos\

I would choose custom.xml and add something like this:

<component type="Documents" context="System">
  <displayName>Exclude Entire D:\Photos Directory</displayName>
  <role role="Data">
    <rules>
         <include>
          </include>
        <exclude>
             <objectSet>
                 <pattern type="File"> D:\Photos\* [*]</pattern>
             </objectSet>
          </exclude>
    </rules>
  </role>
</component>

Then when the tool runs, it should migrate everything based on your redirection, when it comes to Pictures which is redirected to D:\Photos\ it will skip them and as a result be alot faster and move to the next thing.

I understand the explanation above is overly complicated and we are working on further ways to simplify and present this to the admin. But as your issue outlines, each system can be configured differently for a myriad of reasons. By exposing the custom.xml despite being complicated allows a way to solve said issues.

Please reach out and let me know if this helps or I can help further.