Knowledge Base

How to exclude a public folder from migration

Problem:

You would like to exclude a specific public folder from migration when using CodeTwo Exchange Migration or CodeTwo Office 365 Migration.

Solution:

Unfortunately, there is no such option in CodeTwo migration software that would allow you to select which public folders should or should not be migrated. However, by modifying permissions of particular folders, you can force the software to skip them. In other words, the program will not migrate those folders to which the admin account used to perform the migration has insufficient permissions.

Follow the links below to change folder permissions by using:

Changing public folder permissions in Exchange admin center

  1. Log in to your Exchange admin center of your source Exchange server.
  2. Go to public folders > public folders, select the folder you want to exclude from the migration job (in this example, it is folder IT), and click Manage under Folder permissions (Fig. 1.).

Accessing folder permissions in Exchange admin center
Fig. 1. Accessing folder permissions in Exchange admin center.

  1. Click the + button to add a new user account and edit its permissions to that folder (Fig. 2.). This user account needs to be the same account as used in your CodeTwo migration software to connect to the source server. If that user account is already listed in the table shown in Fig. 2., then select that user and click the edit (pencil) button instead (you can also go directly to step 5).

Adding users that can access public folders.
Fig. 2. You need to add the same user account that is used in your CodeTwo migration software.

  1. In the public folder permissions window, click Browse to select the user account in question (i.e. the admin account used in CodeTwo migration software, as specified in step 3 above).
  2. Under Permission level, clear all checkboxes except Folder visible, as shown in Fig. 3.

Specifying permissions for a public folder
Fig. 3. Configuring the minimum permissions for accessing a public folder.

  1. Click Save to save changes.
  2. If there are any subfolders in that folder that you also don't want to migrate, select the Apply changes to this public folder and all its subfolders checkbox and then click Save (Fig. 4.). 

Saving permission changes for the selected public folder and all its subfolders.
Fig. 4. Saving permission changes for the selected public folder and all its subfolders.

Repeat these steps for all public folders you want to exclude from the migration. Once you run the migration job in your CodeTwo software, you will receive the Access is denied notification on the Bad news card for all public folders that failed to be migrated. This is an expected behavior in this case, and you can simply ignore that notification.

Tip

If you want to migrate a specific public folder only out of dozens of other folders, you can simply set the Folder visible permission to the root public folder(s) and propagate folder permissions to all subfolders. Next, select the public folder that you want to migrate and, in the public folder permissions window, select e.g. Owner from the Permission level drop-down menu (Fig. 5.). That way only this folder (and its subfolders, if applicable) will be migrated.

Granting the Owner permission level to a public folder
Fig. 5. Granting the Owner permission level to a public folder.

Changing public folder permissions with Exchange Management Shell

To exclude a public folder from being migrated, perform the following steps:  

  1. Open ems Exchange Management Shell on your source Exchange server.
  2. Type the following command
    Remove-PublicFolderClientPermission -Identity "\folder_path" -User "user_name"
    where \folder_path is the path of the public folder in question (e.g. \Departments\IT) and user_name is the UPN or alias of the user that is used to connect to your source server in CodeTwo migration software (e.g. admin). This will remove all permissions to the specified folder for that user. 
  3. Type the following command
    Add-PublicFolderClientPermission -Identity "\folder_path" -User "user_name" -AccessRights FolderVisible
    to grant the Folder visible permission to that folder for the same user as specified in step 2. 

From now on, the program will migrate your data excluding the chosen folder. However, the MAPI_E_NO_ACCESS error will be logged for the public folders in question as the program will attempt to migrate and stumble upon permissions problem - this error should be considered as a sign of valid configuration. When migrating via EWS, you will receive this notification instead.

Was this information useful?