Folder Filtering

MigrationWiz allows folder exclusions and inclusions using the Regular Expressions (RegEx) syntax.

Filtering folders can reduce the time needed to index the items to be migrated.  MigrationWiz indexes all folder names on the source first, then applies any folder filters.  Then items in folders are indexed, so to adding folder filters will shorten the indexing time needed to identify all folders to be included in the migration.

Folder Normalization:

Here is how MigrationWiz normalizes folder names before applying a specified RegEx to decide if a folder should be skipped:

  • Case Sensitivity - Folder names are compared in a case-insensitive fashion.
  • Folder Separator - Regardless of the messaging system, all folder paths are separated with a forward slash (/) for the purpose of exclusion comparison, for example, Inbox/SubFolder.
  • Preceding Separator - Do not specify any preceding separator when referencing the folder, i.e., do not specify /Inbox/SubFolder but rather Inbox/SubFolder.
  • Trailing Separator - Do not specify any trailing separator when referencing the folder, i.e., do not specify Inbox/SubFolder/ but rather Inbox/SubFolder.
If your folder name is localized (example: "Postvak In" is "Inbox" in Dutch), make sure to use the localized name. 
Folder filters are based on the Source or export side, not the Destination or import side. Therefore, if the Destination has a different format than the Source, it is important for the filter to reflect the Source side. This is common in document migration projects, e.g., Google Drive to OneDrive for Business. For more information, refer to the example filterSyntax: ^(?!My Drive/Some/Folder/Path) in the table below.
^ indicates "match the beginning of the string", meaning that you should filter everything that matches the beginning of the string.
^(?!abc) indicates a negative look ahead , meaning that you only process folders that match the string that follows "^(?!".
Make sure you end the folder path with ")"


​FilterSyntax ​Description
^Inbox/ Do not migrate any subfolders under the Inbox.
(^Inbox$|^Inbox/) Do not migrate the Inbox or any subfolder of Inbox.
(^Folder1$|^Folder2$|^Folder3/) Do not migrate Folder1, Folder2 and any subfolder of Folder3. Note that subfolders of Folder1 and Folder2 are still migrated.
^(?!Inbox$) Migrate only the Inbox. All other folders will be filtered.
^(?!Inbox) Migrate only the Inbox and its corresponding subfolders. All other folders will be filtered.​​
​^(?!Foo/ABC) Only process folders starting with "Foo/ABC"
​^Foo/ABC ​ Skip folders starting with "Foo/ABC"
​^(?!.*Marketing)  Only process folders that have "Marketing" in their path
​^Deleted Items/Frequent Contacts  ​This folder filter will filter out the folder named Frequent Contacts, under the Deleted Items folder, so that it is not included in the migration
​^(?!Inbox/Foo|Inbox/Bar)     ​This inclusion filter means that only Inbox/Foo and Inbox/Bar folders will be migrated. Note: The parentheses are required!
​^(?!INBOX/james1|INBOX/james2|INBOX/samantha|INBOX/john)​ ​Filter everything except INBOX/james1, INBOX/james2, INBOX/samantha and INBOX/john. Therefore, only these four folders will be migrated.
​^(?!My Drive/Some/Folder/Path) ​Only export the subtree under Google Drive that matches: My Drive/Some/Folder/Path. Note: The filter is always based on the source. Therefore, if migrating to OneDrive for Business, then the default destination matching directory path would be "Documents/Some/Folder/Path"  - but the filter is not based off this path because that is the Destination, rather than the Source.


Configuring A Folder Filter For A Project:

  1. Sign in to your MigrationWiz account.
  2. Click the Projectstab if you do not see your Project listed.
  3. From the list, click on the name of your Project. Click on the Edit Project button​.​
  4. Click on the Advanced Options button.
  5. Under Filtering, specify a filter.
  6. Click Save.

Note:  A useful utility for testing RegEx is:


Escaping Special Characters

Example: FolderMapping="^Floor 5-A5-8-T4-\(AV\+TC\)->Calendar" This maps the "Floor 5-A5-8-T4-(AV+TC)" folder to the "Calendar" folder. The part to the left of "->" is regex, so special characters need to be escaped. In the above example, the special characters are escaped with a back slash before the special characters.
Here is a list of the common special characters that would need to be escaped and what each one does:
  • ^ matches the beginning of a string.
  • $ matches the end of the string.
  • {} are used as range quantifier.
  • () are used to group characters.
  • [] are used to create a character class that match a single character.
  • . matches any character except a new line.
  • * is a match 0 or more quantifier.
  • ? is the 0 or 1 quantifier.
  • | separate a series of alternatives.
Was this article helpful?
1 out of 5 found this helpful