A Detailed Guide on Migrating PST Files to Office 365

PST, or personal storage table, is a file format for storing email data in an email client, which allows you to access this data even without an internet connection. When you migrate to Outlook Online with Office 365, you may want to allow users to access their old email client data via the web UI in Outlook Online. To do that, you have to import that data from the PST files to Office 365 email accounts. Read on to learn how to import PST to Office 365 using native Microsoft tools.

Backup for Microsoft 365 Data

Backup for Microsoft 365 Data

Use the NAKIVO solution to back up Microsoft 365 data in Exchange Online, Teams, OneDrive and SharePoint Online for uninterrupted workflows and zero downtime.

Where Do You Find a PST File

A PST (personal storage table) file contains email messages, calendar events, tasks, and other items. If you use Microsoft Office Outlook 2016 in Windows 10, the default location where PST files are stored in Outlook is:

C:\Users\user-name\Documents\Outlook Files

In this example, I’m going to copy the source PST file from one mailbox to D:\temp\pst\ on my machine, and this directory is used as the source directory in my walkthrough.

Setting Permissions

Your Office 365 account must have enough permissions for importing PST files to Office 365. The Mailbox Import Export role must be assigned to your user account in the Exchange admin center.

Let’s start by looking at how to configure the needed roles and permissions.

Open the Exchange admin center:

https://admin.exchange.microsoft.com/

Log in to the admin center by using the administrator credentials.

In the left pane of the Exchange admin center page, select Roles > Admin roles.

On the Admin roles page, click Mailbox Import Export.

Note: Before this step, you may need to add the Mailbox Import Export role to the Organization Management role group. As an alternative, you can create a new role group, assign the Mailbox Import Export role to this group, and then add your user account as a member of this created group.

Configuring roles in the Exchange admin center before importing PST into Office 365

After you click the Mailbox Import Export role group on the Admin roles page, the Mailbox Import Export window opens. In the Mailbox Import Export window, select the Assigned tab, hit the + Add button, and add the needed user account to be used for importing PST files to Office 365.

The Mailbox Import Export role must be assigned to import PST file to Office 365

You can edit other permissions and add roles by clicking Organization Management in the Admin roles list and configuring permissions in the Permissions tab of the Organization management window.

If you are a global administrator of an organization in Office 365, you don’t need to assign additional permissions for a global administrator account. The Mail Recipients role must be assigned to your user account. The Mail Recipients role is assigned to Recipient Management and Organization Management groups by default.

Log in to Office 365 by using the account that has the required permissions (you may need to log out before logging back in if you are logged in at the moment). You may also need to wait for a few minutes until permissions configuration is applied and changes take effect. Microsoft says that the process can take up to 24 hours, but in practice, settings are usually applied within a few minutes.

Importing PST Files

Now you are ready to start to upload PST to Office 365.

Go to https://protection.office.com/ to open Office 365 Security & Compliance admin center.

In the navigation pane, click Information governance, then hit Import.

On the Import page, click Import PST Files.

Importing PST files to Office 365 in the Office 365 Security and Compliance center

Click New Import Job to create a new job and import PST files to Office 365.

Creating a new import job to migrate PST to Office 365

Name your job. Enter a name for your PST files import job, for example, importpst. Hit Next to continue.

Entering a job name

Do you want to upload or ship your data? Microsoft provides two options to migrate PST to Office 365. The first option is to upload your data via the internet. The second option is to write your data on a hard drive and ship the hard drive to a Microsoft data center (there is an additional fee of $2 per gigabyte). I will upload PST to Office 365 via the internet because this method is the most affordable if you don’t have terabytes of information in your PST files.

Select Upload your data, and hit Next.

Upload your data for importing PST into Office 365

Import data. At this stage, you can see four tips that explain what you should do in the corresponding four steps. First, Microsoft recommends that you read their guide to upload PST to Office 365 (see the screenshot below). Now, go to step 2 and step 3.

Click Show network upload SAS URL.

Save the network upload SASL URL and download Azure AzCopy

Copy the generated SAS URL, and save this URL in a safe place, for example, in a password-protected text document. For security reasons, avoid sharing the SAS URL, which contains the secret Shared Access Signature key, with anybody. The SAS key provides the needed permissions to upload PST files to Microsoft Azure cloud storage. A person who has the SAS URL can access the PST files uploaded to Azure.

Viewing the SAS URL for network upload for importing PST files to Office 365

Download Azure AzCopy. Once the AzCopy is downloaded, install this tool. The installation process is straightforward. Run the downloaded installation file (MicrosoftAzureStorageAzCopy_netcore_x64.msi in my case) and follow the steps in the wizard to complete the installation. You can use the default installation path.

The default installation path is C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy

Leave the Import data page open in your web browser because you will need this page later.

Run the installed AzCopy application. You can run the AzCopy shortcut in the start menu. Alternatively, open CMD or PowerShell, go to the folder where AzCopy is installed, and prepare to run AzCopy.exe in the command line interface.

Note: The size of your PST file should not be larger than 20 GB, otherwise performance of the import process will be negatively impacted. By default, the maximum size of one email message supported by Office 365 is 35 MB. This size is defined in the MaxReceiveSize property for a mailbox. If a PST file that you want to import contains messages that are over 35 MB in size, the MaxReceiveSize value can be set to 135 MB, which is the maximum supported value for Office 365 mailboxes.

You can check the maximum size of received messages in Exchange Online PowerShell

Get-Mailbox <user mailbox> | FL MaxReceiveSize

You can also read this blog post about Office 365 Exchange Online and PowerShell.

Now you have to execute the command in the command line interface to run AzCopy with the needed parameters. The command must be executed in the following format:

AzCopy.exe /Source:<Location of PST files> /Dest:<SAS URL> /V:<Log file location> /Y

Where:

/Source:<Location if PST files> is the parameter to define the directory where your PST files are located. You can use a local path on a local machine or a network path to a shared folder on a remote machine. You cannot specify the individual PST file. You can define only the entire folder that contains one or multiple PST files. For example, you can set /Source: “C:\temp” or “\\192.168.1.5\temp\”.

/Dest:<SAS URL> is the parameter to define the destination SAS URL that was provided before (and you must save this URL in a safe place).

/V:<Log file location> is used to set the log file location to output the verbose status of importing PST into Office 365 by using Azure cloud storage. The default name of the log file is AzCopyVerbose.log, and the default location is %LocalAppData%\Microsoft\Azure\AzCopy

/S – enables the recursive mode. Use this command if your source folder specified by the /Source parameter contains subfolders with PST files.

/Y is a required parameter that defines your approval to use write-only SAS tokens to upload PST to Office 365 by using Azure cloud storage. If you don’t use the /Y parameter, you get an error, and importing PST files won’t start.

Be aware that quotas are required for each parameter where you define a location. Otherwise, an error occurs.

In my case, the command to run AzCopy is as follows:

C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy>AzCopy.exe /Source:”D:\temp\pst\” /Dest:” https://f000000000000000abbb000.blob.core.windows.net/ingestiondata?sv=2015-04-05&sr=c&si=IngestionSasForAzCopy202104120951190643&sig=Cc2122R22Y2222DA22R22C2Q2Q22VZ22q227t2337eE%3D&se=2021-05-12T09%3A51%3A20Z” /V:”D:\temp\log” /Y

Copying PST files to Azure storage in the command-line AzCopy tool

Status messages are displayed after executing the command. As you can see in the command line output on the screenshot above, one PST file has been transferred successfully to Azure cloud storage. If the command was executed correctly, it is recommended that you save this command to a safe location, for example, to the password-protected document where you saved the SAS URL earlier. If you need to upload PST files to Azure in the future, use this saved command with the needed parameters.

Verifying that the PST File Has Been Uploaded

Next, you should verify that your PST files have been uploaded to Azure cloud storage successfully before you continue to migrate PST to Office 365. Verification allows you to ensure that PST files are copied successfully without corruption and prevents possible errors in the following steps. You can also verify the names of uploaded files in Azure and the path of subfolders, which is useful when you need to configure the PST mapping file in the CSV format. With correct names, you have less chances for errors.

Download Microsoft Azure Storage Explorer, which is a free, open-source tool from the Microsoft website, by using this link:

https://azure.microsoft.com/en-us/features/storage-explorer/

Windows, Linux, and macOS are supported. In my case, I downloaded the Windows version.

Run the downloaded installer to install the Storage Explorer. The installation process is straightforward. Follow the recommendations in the installation wizard to complete the installation. You can use the default installation path.

.NET Framework 4.7.2 or higher is required to run the application in Windows (for Azure Storage Explorer 1.18.1).

The application has a graphical user interface. Once you have opened Azure Storage Explorer, click Add an account in the Account Management section of the window.

Adding an account in Microsoft Azure Storage Explorer

Select Resource. In the window that opens, select the resource where your uploaded PST files are located. Select Blob Container to attach a blob container to the current instance of Azure Storage Explorer.

Attaching a blob container

Select Authentication Method. Select Shared Access Signature (SAS) to authenticate requests of Azure Storage Explorer to the blob container. Then hit Next to continue.

Selecting shared access signature as the authentication method

Enter Connection Info. Enter a display name, for example, PST import. Then enter the blob container SAS URL (that you obtained earlier and saved to a safe location) in the appropriate field. Hit Next.

Entering the blob container SAS URL

Summary. Check your settings that will be used to connect to your source in the Azure cloud where the PST files are located now. If everything is correct, click the Connect button.

Viewing summary for connecting to Azure storage

Now Microsoft Azure Storage Explorer is connected to the needed blob container in Azure storage. On the screenshot below, you can see that my PST file (Michael Bose pst) has been uploaded successfully.

Checking PST files after copying them to Azure before importing to Office 365 mailboxes

After you verify that the import to Azure has been completed successfully, you can disconnect from Azure storage and close Azure Storage Explorer.

Creating the PST Mapping File

After uploading PST files to Azure and checking them, create the PST mapping file to define which PST files must be imported to which Office 365 user accounts. The mapping file is saved in a CSV format (comma-separated value).

Download the template to map PST files to Office 365 user accounts from the Microsoft website:

https://go.microsoft.com/fwlink/p/?LinkId=544717

The file name is PstImportMappingFile.csv in this case. Open this CSV file in a spreadsheet editor, such as Microsoft Office Excel, to edit the file. Don’t change any information in the first row (the header row). Create one row for each PST file. Let me go over each column and explain which parameters you should enter.

Workload. This parameter is used to specify the service to which data must be imported. As you are importing PST files to Exchange, enter the Exchange value for all cells of this column.

FilePath. You can specify a folder name in Azure storage if you have used subfolders in previous steps when importing PST files to the cloud. If you have not specified subfolders, leave this parameter blank. I’m leaving the parameters in the FIlePath column blank.

Name. Enter the name of the PST file for each user account. The PST file name in this table must be the same as the name of the source PST file that was imported to Azure cloud storage from your local machine. The parameters for each user account are defined in a separate row. In my example, I am importing one PST file of Michael Bose, and I have to enter the name of this PST file (Michael_Bose.pst). This value is case sensitive. The name of the CSV file must be unique for each user.

Mailbox. Specify the email address of the destination Office 365 user mailbox for each PST file. Each PST file will be imported to the appropriate destination Office 365 mailbox you set in this column. Public folders are not supported. You can import PST to Office 365 inactive mailboxes. Run the Get-Mailbox <identity of inactive mailbox> -InactiveMailboxOnly | FL Guid command in Exchange Online PowerShell to obtain the GUID of the inactive mailbox. Then enter the GUID in the Mailbox field of the inactive user to define this parameter instead of entering the name of the user account. You can also define a unique GUID instead of a mailbox name for active users. If you need the GUID for an active mailbox, use the Get-Mailbox <identity of active mailbox> | FL Guid command. To get the GUID of a soft-deleted mailbox, use the Get-Mailbox <identity of soft-deleted or inactive mailbox> -SoftDeletedMailbox | FL Guid command. In my example, I am importing one PST file of Michael Bose and using the michaelbose@nakivo.microsoft.com Office 365 account as the destination.

IsArchive. This parameter has two values: TRUE and FALSE. Use the TRUE value if you need to import the PST file to a user’s archive mailbox (the archive mailbox must be enabled in this case). Use the FALSE value to import a PST file to a user’s primary mailbox. If you define the TRUE value for a mailbox and the archive mailbox is not enabled for this user account, the import operation will fail for the current user. If the IsArchive parameter is defined correctly for other users of the PST files import job, these users are not affected. In my example, I don’t need to use the archive mailbox, and as a result, I use the FALSE value.

TargetRootFolder. Use this parameter to specify the mailbox folder for a user’s email account in Exchange Online. If you specify /PSTimported as TargetRootFolder, the PSTimported folder will be created in a user’s mailbox, and all data will be imported to the appropriate subfolders of this folder. If you leave this parameter blank, a PST file is imported to the Imported folder, which is automatically created at the root level of the mailbox folder structure for the current user. If you define / as the TargetRootFolder parameter, then import the content of the PST file to the top of the folder structure in the destination mailbox of a target Office 365 user.

ContentCodePage. This parameter specifies the code page for importing PST files into Office 365 in the ANSI format. In most cases, you should use the blank value (default). You can set 932 if you want to use the ANSI/OEM Japanese code page.

Leave empty other fields on the right side.

Save changes to the CSV file after completing configuration. It is recommended that you create at least one test batch by using a CSV file with a small number of users and try importing PST into Office 365 with this configuration. If everything works properly, run the PST file import job with the full list of users and the configured CSV file. The content of my CSV file used in this walkthrough is displayed on the screenshot below.

Editing the PST mapping file

Creating the PST File Import Job

You are ready for the final stage of importing PST files to Office 365 mailboxes. Go back to the Import data window, which should be open still in your web browser. You have copied the SAS URL from this page before. If you’ve close this tab in the web browser, you can re-open the page after opening the Office 365 Security & Compliance admin center (Information governance > Import).

After you have uploaded CSV files to Azure cloud storage and configured the CSV file, which is accessible on your machine, select the checkboxes:

  • I’m done uploading my files
  • I have access to the mapping file

Then hit Next to continue.

Resuming the process of importing PST files to Office 365 mailboxes

Select the mapping file. Click Select mapping file, and in the pop-up window, select the CSV file that contains the mapping information. Upload your CSV file. After selecting and uploading your CSV file, click the Validate button to check for common errors in the mapping file. If there are no errors, the file name is colored green. Then hit Save.

Selecting the mapping file

The PST file import job is now added, and the Success status is displayed. You can close this window.

An import job has been added for importing PST into Office 365

Importing PST into Office 365 is being started now. Check the status of your PST files import job by clicking Refresh. At the beginning of importing PST files to Office 365 mailboxes, the status is Analysis in progress (see the screenshot).

Importing PST files to Office 365 – analysis is in progress

Once the analysis is completed, click Ready to import to Office 365.

Importing PST files to Office 365 – analysis is completed

In the window that opens, check your uploaded PST files, and click Import to Office 365.

Importing PST into Office 365 after analysis

Data filtering

You can configure data filtering options to define which data should be imported to Office 365 user mailboxes. On the Filter your data step, specify whether you want to filter your data. Select one of the options:

  • Yes, I want to filter data before importing
  • No, I want to import everything

Click Next to continue.

Office 365 import PST – filtering options

If you choose to filter your data, you can select filtering options, such as to import data based on the age of data. For example, you can select to import data less than 2 years old or import data that is less than 1 year old. Click More filtering options to select the message types to import or select messages received/sent by specific users. Filtering options depend on the analysis of PST files performed before by Office 365. Hit Next to continue.

Selecting filtering options to migrate PST to Office 365 mailboxes

Review your filter settings. Check the defined filtering settings to import data from PST files to Office 365. If the settings are correct, click Import data to start importing PST files to Office 365 mailboxes.

Reviewing filtering settings

The Success status is displayed in my case. You can read the information about the amount of data that will be imported and then close this window.

Importing PST into Office 365 can be started

Wait until importing PST files to Office 365 mailboxes has finished. You can click Refresh and check the job status on the Import PST files page. While the job is running, the status is Import in progress. Be patient and wait until the job is completed. The process is time-consuming. You can close this tab in your browser and re-open this page later to check the status.

Import PST file to Office 365 – import in progress

When the job is completed, the Completed status and 100% are displayed in the progress bar.

Importing PST into Office 365 is completed

When importing PST files is completed, you can check the imported data in the mailbox. Let’s log in to https://outlook.office.com and check the imported data for my email account used in this tutorial. As you can see on the screenshot below, data was imported to the Primary Mailbox folder. For example, the imported mailbox folder is located in Primary mailbox > Mailbox.

Checking data imported from a PST file to the Office 365 mailbox

Conclusion

You can use native Microsoft tools to migrate data from PST files to Office 365 user mailboxes. One of the advantages of importing PST files to Office 365 is the ability to access old email data from any machine connected to the internet even if the user doesn’t have access to the machine on which the email client with the PST file is installed. Another advantage of importing PST files to Office 365 is the ability to copy the data of all Office 365 users within an organization centrally.

However, this method can’t be considered a sufficient replacement for Office 365 backup solutions. NAKIVO Backup & Replication is a universal data protection solution that supports Office 365 backup and recovery. The solution can back up Exchange Online, including email messages, OneDrive, and SharePoint Online data. You can recover entire mailboxes or individual emails to source mailboxes or to the mailboxes of other Office 365 users.

1 Year of Free Data Protection: NAKIVO Backup & Replication

1 Year of Free Data Protection: NAKIVO Backup & Replication

Deploy in 2 minutes and protect virtual, cloud, physical and SaaS data. Backup, replication, instant recovery options.

People also read