Exporting and Restoring Mailbox Data
This section explains how to export and restore backed-up data from organization mailboxes.
Request
POST https://<hostname>:4443/v4/RestoreSessions/{restoreSessionId}/Organization/Mailboxes/{mailboxId}/Action |
Request Headers
The request header must contain an authorization token of the current session.
Request Body
Export to PST
Important! |
To export data to .pst files, you must have a 64-bit version of Microsoft Outlook 2016, Microsoft Outlook 2013 or Microsoft Outlook 2010 installed on a computer running restore sessions. |
To export backed-up data from the organization's mailbox to a PST file (Personal Folder File), the request body must contain the exportToPst action property:
Property | Type | Description |
---|---|---|
ContentKeywords | string | Specifies the keyword to query backed-up mailbox data. |
EnablePstSizeLimit | boolean | Defines whether to set the size limit for the exported .pst file. If set to true, make sure to specify the PstSizeLimitBytes parameter. |
PstSizeLimitBytes | integer | Sets the limit of the exported .pst file. You can choose the limit range from 1 GB to 49 GB. |
For example:
{ "exportToPst": { "contentKeywords": "support", "EnablePstSizeLimit": true, "PstSizeLimitBytes": 1073741824 } } |
The request command will look for a specified keyword in data inside the organization's mailbox. The backed-up data with a specified keyword then will be exported to a PST file and placed to a temporary folder on the Veeam Backup for Microsoft Office 365 server. After that, the PST file will be transferred as application/octet-stream media to the client. To download, read, convert to PST or perform other actions with the octet-stream, use features of programming languages.
If the size of the exported data exceeds the limit specified for the PST file, Veeam Backup for Microsoft Office 365 splits the PST file into separate files and exports these files to an archive file of the ZIP format. For example, you specified 1 GB as the PST file size limit. The size of the exported data is 1.5 GB. In this case, Veeam Backup for Microsoft Office 365 will export data to a ZIP archive. The archive will contain two PST files: one PST file of the 1 GB size and another PST file of the 0.5 GB size.
Tip: |
You can use Swagger UI to download the octet-stream file by clicking the Download action link, which server returns in the response body after a successfully completed export operation. |
Restore to the same Exchange server
To restore backed-up organization's mailbox data to the same production Exchange server, the request body must contain the restoreToOriginalLocation action properties:
Property | Type | Description |
---|---|---|
UserName | string | Specifies the user name you want to use for authenticating with the Exchange organization. For example, "userName": "jsmith@westsupport.onmicrosoft.com". |
UserPassword | string | Specifies the user name you want to use for authenticating with the Exchange organization. For example, "userPassword": "paSSw0rd". |
userCode | string | An authentication code. Can be obtained, as described in Getting Device Code. |
ApplicationId | string | An identification number of the Azure AD application that you want to use for a restore. |
ApplicationCertificate | base64 | An SSL certificate that is configured for the AD application being used. |
ApplicationCertificatePassword | string | A password for the SSL certificate being used. |
Request Example 1
The following example shows how to use a user name and password for a restore.
{ "restoretoOriginallocation": {"userName": "jsmith@westsupport.onmicrosoft.com", "userPassword": "paSSw0rd" } } |
Request Example 2
The following example shows how to use a device code for a restore.
{ "restoretoOriginallocation": { "userCode": "C6A9DB737" } } |
Request Example 3
The following example shows how to use a certificate for a restore.
{ "restoretoOriginallocation": { "ApplicationId" : <app_id>, "ApplicationCertificate": "MIIKEgIBAzCCCc4GCSqGSIb3DQEHAaCCCb8Eggm7MIIJtzCCBggGCSqGSIb3DQEHAaCCBfkEggX1MIIF8TCCBe0GCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAg7S8DZJqMJuwICB9AEggTYsQotlTjAJnBl4ssVRewseXE+zDTZgr8i0FwJdrUYaR4pnmD/eKkcjIMmxLgBXF/yEUEPpBOUxksmtABLADc6+sY9L7OOPJPPuB+XtMOW0xBlLPHrf4AM18gsAjW116BmMP8Haf4nYAQHJ39idxF+7haVDNSYJJTgs0ijmyNxOJLqYQElHJYE9KshqT0lLDtc007EhyG2fh5/fcMeRg7iQpENkkBhtC86FXS1qmNtkUXNVWy8tnXkY2jy5DTi3Aqvb+1fAJpfbGIQRakYyA6fDWhpg/5pYJWSJCmStrbGpMiUlvuqqiGp1Ivwi+3kou6/DFYxA0SJ5pjUOBaLbibcHNReYU/Rszo+rG2jCKfRaD8O8DSdVeqoXruNtSQtzg0wr7/revx9BSJnq0qfEJXD2j4XO99fbw8i6chHkJbY5ABFKWLGQbx6DOB5kjYQKqNKluoKSUctN0H5I8w+miDOUf9sDu5UoiuMbpXoVewaOo76ftijYLBRcTJVFNVvxXBkScGX0NaQoUUywFpDiD402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NAhiAcd3xN7D/EXk1SNn4agZhyPPiqOCSXDhL30AjyNPsPB6kEimGxQKHy+oI90xwtK86t69oOkhGaJTVNulFH2G+mg2end+XeOAcR0Jj8JxGOcuFbhQVAZDGgljCEm94DmCHtYzz6ZP9GwVmgJGuRNGtJn8/5brv+ibL+Zpqe7dG5YY+BXDY2KoRnZSn2QMOKrQOgTu+/oQKspx4o5NCL2dOypP1pFjBNvSqXCxIu4nqOr9dCXc2f63XJ0S7HejUj4Ep3D1Vi6/Nh2mkZWNhiqtI7Cc9QAjo5DRd+OqjCIfP9s8FIXYnA5znyuQFNFVWDJ37AL2y/DFxPQTCosGCKnztZ/Ycurob+/FufJW7/gwmuFD6lgirWaSMaqc5JK2FZVvLS5VDd4k92/WKk+luxUdzEzGn4/PZfGrNJJcbQ6pLZS5c8QRc8rGYormvJIFUn2u4RJaRZGhLzRu2fpmIhWqWgwXtt8XVvrGJ3sdl1lHxPH+Cl+saXK0TTD7jA7MB8wBwYFKw4DAhoEFKcrbAfmDaDdM8n0qonvDola5JVsBBSOBZavEN2v/i1YfP42r9vRTMqXTwICB9A=", "ApplicationCertificatePassword": "xxx", } } |
Restore to a different Exchange server
To restore backed-up organization's mailbox data to a different production Exchange server, the request body must contain the restoreTo action properties:
Property | Type | Description |
---|---|---|
CasServer | string | Specifies the Microsoft Exchange server with Client Access Server (CAS) role. The mailbox data will be restored to a specified mailbox server. For example, "casServer": "outlook.office365.com". |
Mailbox | string | Specifies the email address of the mailbox to which you want to restore mailbox data. For example, "mailbox": "djohnes@northsupport.onmicrosoft.com". |
UserName | string | Specifies the user name you want to use for authenticating with the Exchange organization. For example, "userName": "djohnes@northsupport.onmicrosoft.com". |
UserPassword | string | Specifies the user name you want to use for authenticating with the Exchange organization. For example, "userPassword": "paSSw0rd". |
ChangedItems | boolean | If set to True, indicates that all versions of mailbox items will be restored. For example, "changedItems": "true". |
DeletedItems | boolean | If set to True, indicates that deleted mailbox items will be restored. For example, "deletedItems": "true". |
MarkRestored | boolean | If set to True, indicates that restored mailbox data will be marked as unread. For example, "markRestoredAsUnread": "false". |
ExcludeDrafts | boolean | If set to True, indicates that Drafts mailbox folder will not be restored. For example, "excludeDrafts": "false". |
Exclude | boolean | If set to True, indicates that Deleted Items mailbox folder will not be restored. For example, "excludeDeletedItems": "false". |
Exclude | boolean | If set to True, indicates that preserved items of mailboxes placed on In-Place Hold will not be restored. For example, "excludeInPlaceHoldItems": "true". |
Exclude | boolean | If set to True, indicates that preserved items of mailboxes placed on Litigation Hold will not be restored. For example, "excludeLitigationHoldItems": "true". |
userCode | string | An authentication code. Can be obtained, as described in Getting Device Code. |
ApplicationId | string | An identification number of the Azure AD application that you want to use for a restore. |
ApplicationCertificate | base64 | An SSL certificate that is configured for the AD application being used. |
ApplicationCertificatePassword | string | A password for the SSL certificate being used. |
Response
The server returns the following response to the client.
Response Codes
A successfully completed operation returns a response code 200 (OK).
Response Headers
The response to this request contains the following headers. The response may also include additional standard HTTPS headers.
Header | Description |
---|---|
Content-length | The length of the response body. |
Content-type | The media type and syntax of the response body message for the requests with the export action: application/octet-stream. The media type and syntax of the response body message for the requests with the restore actions: application/json; charset=utf-8. |
Response Body
In the response body, the server returns the following data:
- [For the export action] Binary data stream
- [For restore actions] Information about restore operation results
Example 1
The following request exports backed-up organization's mailbox data containing "support" keyword to a PST file.
Request: POST https://abc.tech.local:4443/v4/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Action
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "exportToPst": { "contentKeywords": "support", "EnablePstSizeLimit": false } }
Response: 200 OK |
Example 2
The following request restores backed-up organization's mailbox data to the same production Exchange server.
Request: POST https://abc.tech.local:4443/v4/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Action
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "restoretoOriginallocation": {"userName": "jsmith@westsupport.onmicrosoft.com", "userPassword": "paSSw0rd", } }
Response: 200 OK |
Example 3
The following request restores all versions of organization's mailbox data to a different Exchange server.
Request: POST https://abc.tech.local:4443/v4/RestoreSessions/380d7caf-6294-4a33-b50a-b8aeb13af58c/Organization/Mailboxes/9e9b7199-f547-467a-b580-9d283a75eaad/Action
Request Header: Authorization: Bearer <Access-Token>
Request Body: { "restoreTo": {"casServer": "outlook.office365.com", "mailbox": "djohnes@northsupport.onmicrosoft.com", "userName": "djohnes@northsupport.onmicrosoft.com", "userPassword": "p@s$w0rd", "changedItems": "true", "deletedItems": "false", "markRestoredAsUnread": "false", "excludeDrafts": "false", "excludeDeletedItems": "false", "excludeInPlaceHoldItems": "false", "excludeLitigationHoldItems": "false" } }
Response: 200 OK |