Importing PSTs Into Exchange Online – Part One

PST Files. Bane of a messaging engineers’ existence. PST files stored away on home drives, local computers, USB sticks, you name it, its out there. Ingesting PST files takes up disk space. To some, valuable disk space. However, as a long time user of Exchange, I would rather spend the money to store these emails in a reliable database instead of in a fallible file type. Even better, for those migrating to Office 365, take advantage of the large mailbox sizes allowed, and import them into your cloud mailbohttps://justaucguy.wordpress.com/wp-admin/edit.phpx.

Ingesting these PST files needs to be planned no matter the end destination. For Exchange Online, there were two choices, import them into the mailbox while it was on-premises and then migrate the larger mailbox to the cloud OR use the PST Import Tool from Microsoft which did not work as well as expected. I chose to perform the first choice for all my migrations due to speed, efficiency and reliability of importing the data with PowerShell.

Now Microsoft has come out with a new way to move your PSTs to the cloud, the PST Import Service, more information can be found here on TechNet. What you will find is that there are a few steps and a few requirements that need to be met prior to uploading these PST files and importing them. In this blog article I will walk you through all the steps you need into to make this successful.

(1) Preparation

Before PST files can be copied to temporary Azure Storage and then imported into your Exchange Online Tenant, a server with the Azure Storage Tools needs to be installed. To download this tool, download it from this link for version 3.2 of the tools.. After downloading it, make sure the server / workstation that you are installing the software on has .Net 4.5+. The installation process is pretty simple:

AzureToolInstal-1

AzureToolInstal-2

AzureToolInstal-3

AzureToolInstal-4

AzureToolInstal-5

(2) Permissions

Once installed don’t forget that the account used to import the PST files will need to have mailbox import export rights. To do this, log into your Office 365 tenant and go to the Exchange Admin part of Office 365. Once there, we need to create a new Role Group ‘Mailbox Import Export’

MailboxImportGroup2

Once this right has been granted, wait 60 minutes before importing any PSTs into Exchange online to allow for it to propagate.

(3) Copy File to Azure

Importing a file to Exchange online, requires that file to be in Azure File Storage in order to be accessed. We then need to move the PST files with a tool called AZCopy. The tool can be downloaded from this direct download. To utilize AZCopy we will need to get two key pieces of information from the Office 365 tenant console. To get there, log into your tenant, click on the Import button on the left and you will get to this screen:

ImportScreen

From there click on the button that looks like a key which brings you to this screen:

TwoKeyPieces

Next click on Copy Key, which will generate an 88 character key to be used later.
Then click on Copy URL, which will generate a unique URL for you to use that will look like this:

https://.blob.core.windows.net/ingestiondata/

Once we have these we can begin to build a copy command for AzCopy. To make it easier, place all the PST files in a central location and share it out. Once the PST files are ready, open up a command prompt and browse to the C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy directory – which is the default install directory. Then construct your AzCopy command:

Azcopycommand

A text version of the above diagram is here:

AzCopy.exe /source:\\SERVER01\PSTSHARE /dest:https://.blob.core.windows.net/ingestiondata/SERVER01/PSTSHARE /destkey: /S /V:C:\PSTSHARE\upload.log

Once you have your command structured, run it to see if the import works:

Successful upload
SuccessUpload
Failed Upload
Failed-upload

If your file(s) have successfully been copied to Azure File Storage, move on to the next step.

(4) Create CSV File for Import

When the Import job is created, a CSV file is needed in order for the tool to locate the files in Azure, know where to place it (Exchange Online, What mailbox, and then what folder in the mailbox).

CSVFileFormat

For this migration, I used the Workload, FilePath, Name, Mailbox, IsArchive and TargetRootFolder columns. The Workload will be Exchange for all PST imports. The FilePath is where this is stored in Azure Storage, which should be the servername/sharelocation. Name is simply just the file name for the PST file to import. IsArhcive is if we want the PST file to be imported into an archive. and TargetRootFolder is where the emails should go upon being imported. “/” is the root of the Inbox, which is what I need for an import I worked on.

(5) Create Import Job

** Make sure your permissions are correct, otherwise the job will fail and you will have to wait for the permissions to apply

From the same place in the Office 365 console where we generated the key and URL, we can also create a new import job for the files we copied to the cloud. Click on the ‘+’ and select ‘Upload Files Over the Network’ to create the new job:

ImportJob

Check off the two checkboxes and click ‘Next’. Enter a name for the job:

ImportJob2

Ooops… the above job name is correct. It needs to be without space and without capital letters … like this:

ImportJob3

Now we can click Next. Find your CSV file and select it on this screen:

SelectCSV

Click next and see the job that was created:

ImportJobs

Once the job has reached a completed status, your PST file has been imported.

Overall File Import Process

One thing to remember is that the file import is a two-step process, from copying the file to Azure and then importing the PST into Exchange online.

CopyProcess

My overall impression is that while there are some hurdles to get over and there is some work involved, it is much easier and much more reliable than the PST Import Tool that existed before this process was around. The reliance on Azure storage is good / bad and the acceptance of PowerShell to manage the imports is a welcome change.

Further Reading
CSV File formatting

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s