Microsoft Exchange Server-dan Microsoft 365-ə arxivləməni dəyişmək
Bu məqalədə, e-poçta ortamını yerli bir Microsoft Exchange quraşımından Microsoft 365-ə keçirərkən MailStore Server-da tələb olunan dəyişikliklər göstərilir. Texniki İpucu videomuz ümumi baxış təmin edir. Zəhmət olmasa, nümunədə göstərilən adımlar mevcut konfiqurasiyaya görə fərqli ola biləcəyini unutmayın.

## Technical Tip: Changing Archiving from Microsoft Exchange Server to Microsoft 365
## Notes and Things to Consider
Any change in a production environment, including changing archiving in MailStore Server, should be carefully planned in advance. Therefore, before applying any changes, please consider the following notes:
- It is strongly recommended that the changes described in this article be applied first in a test environment, as changes to your Exchange and MailStore Server installations may not be easily rolled back without significant effort.
- Before applying any changes to your production environment, please ensure that you have up-to-date backups of your Exchange and MailStore Server installations. For Service Provider Edition, see the Backup article.
- It is recommended that you update MailStore Server to the latest version before making any changes. Please ensure that your Update and Support Service Agreement is valid (not related to Service Provider Edition) and consider the update notifications (MailStore Server) / update notifications (Service Provider Edition).
- It is assumed that MailStore Server currently operates in an Active Directory / Exchange Server environment according to the MailStore Application Guide for Microsoft Exchange Servers and will subsequently operate according to the MailStore Application Guide for Microsoft 365 (Modern Authentication).
- Changes to MailStore Server's configuration should be applied in Safe Mode to prevent interference with background tasks or user interaction. For Service Provider Edition, see the "Safe Mode" section in the Management Console.
- Disable all scheduled tasks in the Windows Task Scheduler that perform directory service synchronization, trigger archiving, or otherwise interfere with archiving.
- Microsoft 365 does not support daily mailboxes hosted within Microsoft 365. If you archive all incoming and outgoing emails with MailStore Server, you will need a daily mailbox hosted outside of Microsoft 365. MailStore offers the free solution called MailStore Gateway, which can provide daily mailboxes within your company's intranet.
## Changing User Synchronization
As a first step, you should change the directory services that MailStore Server synchronizes user accounts from *Active Directory* to *Microsoft 365 (Modern Authentication)*. This is necessary because Microsoft 365 uses Azure Active Directory instead of the local Active Directory as a directory service.
Initially, please run a [directory services synchronization](https://help.mailstore.com/en/server/Active_Directory_Integration#Running_Directory_Services_Synchronization) with the current configuration in MailStore Server to ensure that all user data is complete and up-to-date.
## User Name Format
The steps required to change the directory service are dependent on the [user name format](https://help.mailstore.com/en/server/Active_Directory_Integration#User_Database_Synchronization) used in MailStore Server for user synchronization with the local Active Directory.
- If you are currently using SAM Account Name or User Principal Name (Local Part), that is, a "flat" user name without the domain part in the user name on MailStore Server (e.g., john.doe), then users and archive folders should be renamed on MailStore Server. In this case, please follow the steps in the next section.
- If you are already using the full User Principal Name (UPN, e.g., john.doe@example.com) as the user name on MailStore Server and this UPN will be used to log in to Microsoft 365 in the future, you can leave the user names, archive folders, and source folders as they are. Please proceed directly to the section "Changing Directory Service Synchronization to Microsoft 365."
- If you want to change the naming convention of the UPN (e.g., from where or whom) used to log in to Microsoft 365, the user names, archive folders, and source folders on MailStore Server need to be renamed. In this case, please follow the steps in the next section. john.doe@example.comjdoe@example.comjane.doe@example.comjane.doe@example.org
### MailStore Migration Scripts
The following changes are based on Windows PowerShell scripts that require Windows PowerShell 3.0 or higher.
- You can download the scripts for MailStore Server from here; they will be found in the folder after extraction. For Service Provider Edition, please use these scripts instead.
- To use the scripts with MailStore Server, access to the MailStore Management API must be enabled in the MailStore Server Service Configuration.
- For Service Provider Edition, access to the respective instance should also be enabled.
### Renaming Users and Archives on MailStore Server
MailStore Server identifies users only by their user name. For example, two different users would be considered two separate users from the perspective of a MailStore Server that requires two licenses. Additionally, a user's archive is only associated with the user name, so MailStore will always create an archive named *john.doe* for a user named john.doe. However, if such an archive contains archived emails, it will retain its name even if the associated user name changes. john.doejohn.doe@example.comjohn.doe
For this reason, the user names and archive folders on MailStore Server must match the user names of the directory service that MailStore Server synchronizes with. Since Microsoft 365 uses the full *User Principal Name* (*UPN*, usually the primary email address) as the directory service user name, if you are currently using a different user name format or wish to change the *UPN*, you need to rename the users and archive folders.
To rename users and archive folders, please do the following (for Service Provider Edition, files have the *SPE_* prefix, but they behave similarly):
- Edit the scripts and set the values in the section "Setting values according to your MailStore Server installation" in PowerShell ISE. MSS_1_prepare_users.ps1MSS_2_update_users.ps1
- Run the script in PowerShell ISE by pressing F5. MSS_1_prepare_users.ps1
- A file is created (by default in the folder). It contains the current MailStore Server user names. mailstore-users.txtC:\Users\\
- Edit this file in a text editor and change the new user names after the "=" sign so that entries look like this: AD user name=Microsoft 365 user name Example (with changes highlighted) jane.doe=jane.doe@example.com Please use only lowercase letters for the user names. For user names that should not change (e.g., the default admin user), simply leave the corresponding entries as they are.
- Save the file containing both current and future user names. mailstore-users.txt
- Run the script in PowerShell ISE by pressing F5. MSS_2_update_users.ps1
- The script now renames the users and archive folders in MailStore Server and updates the archive folder permissions accordingly.
- Log in to MailStore Server as a MailStore Administrator using the MailStore Client and check the new user names and archive folders.
- If the local part of the email addresses ("@") hasn't changed, you can directly proceed to the steps in the section "Changing Directory Service Synchronization to Microsoft 365." Otherwise, the source folders may need to be renamed as described in the next section.
### Renaming Source Folders on MailStore Server
The folder level under archive folders reflects the source that MailStore Server archives emails for. In the Exchange archiving scenario, the folder name is formed from the *Exchange* prefix and the local part of the email address (the part before "@"), so that the source folder name for the email address on MailStore Server would be *Exchange john.doe@example.com*. john.doe@example.com
The source folder names should only be renamed if all of the following conditions and requirements are met. Otherwise, you can directly proceed with the steps in the "Changing Directory Service Synchronization to Microsoft 365" section.
- The local part of the email address will be changed during the transition to Microsoft 365 (e.g., john.doe@example.comj.doe@example.com
- Both the emails archived from the local Exchange Server up to now and the emails that will be archived from Microsoft 365 in the future should appear under the same folder structure at the source level (e.g., Exchange john.doe and Exchange j.doe).
To rename source folders, please perform the following steps:
- Enable access to user archives for administrators on MailStore Server; it is disabled by default. This change is explained in the "Compatibility General" section of the MailStore Server guide.
- Edit the scripts and set the values in the section "Setting values according to your MailStore Server installation" in PowerShell ISE. MSS_3_prepare_folders.ps1MSS_4_update_folders.ps1
- Run the script in PowerShell ISE by pressing F5. MSS_3_prepare_folders.ps1
- A file is created (by default in the folder). It contains the full paths of existing source folders, separated by "/", consisting of user names and source folder names. mailstore-folders.txtC:\Users\\
- Edit this file in a text editor and change the new source folders after the "=" sign so that entries look like this: Old source folder path=new source folder path Example (with changes highlighted) j.doe@example.com/Exchange jane.doe=j.doe@example.com/Exchange j.doe For source folders that should not be changed, leave the corresponding entries as they are.
- Now save the file containing both current and future source folders. mailstore-folders.txt
- Run the script in PowerShell ISE by pressing F5. MSS_4_update_folders.ps1
- The script now renames the source folders in MailStore Server.
- Log in to MailStore Server as a MailStore Administrator using the MailStore Client and check the new source folders.
### Changing Directory Service Synchronization to Microsoft 365
To allow users to log in to MailStore Server with their Microsoft 365 credentials instead of Active Directory, you need to change the directory service synchronization to *Microsoft 365 (Modern Authentication)*. Please follow the steps in the section "Synchronizing User Accounts with Microsoft 365 (Modern Authentication)" of the MailStore Server guide. Initially, test the synchronization using the *Test Settings* button. Check the directory service synchronization results; the migrated users should be displayed as *changed*. You can also check if user authentication against Microsoft 365 works as expected.
## Changing Archiving Profiles
MailStore Server provides special Microsoft 365 archiving profiles that support modern authentication for archiving Microsoft 365 mailboxes. The current Exchange archiving profiles, which only support basic authentication, cannot be used for archiving Microsoft 365 mailboxes.
### Disabling Current Profiles and Jobs
If you run MailStore Server as previously recommended in *Safe Mode* (https://help.mailstore.com/en/server/MailStore_Server_Service_Configuration#Controlling_the_Service), the automatic execution of archiving profiles and jobs is disabled (for Service Provider Edition: [Management Console](https://help.mailstore.com/en/spe/Management_Console_-_General), Safe Mode). To disable them permanently, please proceed as follows:
- Log in to MailStore Server as a MailStore Administrator via the MailStore Client.
- Click *Archive Emails*.
- Enable the option *Show All Users' Profiles* under the profile list.
- From the context menu, change each Exchange archiving profile to *Manual*.
- If you have configured Exchange export profiles, click *Email Export* in the menu tree and repeat the previous steps.
- If you have scheduled jobs to run Exchange profiles, click *Jobs > Management Tools > Management API* and disable each job that runs an Exchange profile from the context menu.
### Creating New Microsoft 365 Profiles
Create new Microsoft 365 profiles and jobs according to the following articles. They should be initially set up manually to check their execution and results.
- Follow the application guide for *Email Archiving from Microsoft 365 (Modern Authentication)* to archive Microsoft 365 mailboxes.
- The creation of Microsoft 365 export profiles is described in the *Email Export* section of the MailStore Server guide.
- After setting up the profiles, you can update the existing jobs as described in the *Jobs* section of the MailStore Server guide.
## Finalizing the Transition
To complete the transition on MailStore Server, please perform the following steps:
- Close all MailStore Client sessions and restart the MailStore Server service.
- Log in again to MailStore Server as a MailStore Administrator via the MailStore Client.
- Go to *Users and Archives > Archives > Administrative Tools* in the main menu tree and check the names of the archive folders.
- Go to *Archive Emails* and manually run each Microsoft 365 archiving profile. If you are satisfied with the results, you can delete the old Exchange archiving profiles.
- If possible, repeat the previous step to export the profiles and jobs.
- If you have enabled access to user archives by administrators on MailStore Server as described in the *Compatibility General* section, revert this change.
- If you have enabled *Single Sign-On (SSO)* by setting the server name and authentication method of the MailStore Server computer to *Windows Authentication* via Group Policy for the MailStore Client or the MailStore Outlook Add-in, you need to change the *Authentication* group policy setting to *Standard Authentication*.
- During login, the MailStore Web Access, MailStore Clients, and Outlook Add-in call the default web browser to allow users to log in via the Microsoft 365 login dialog box; this communication is encrypted with TLS over HTTPS. Therefore, it is recommended to configure a trusted SSL certificate on MailStore Server for a better user experience. For more information, see the article *Using Your Own SSL Certificate* (for Service Provider Edition: *Replace Self-Signed SSL Certificates*).
After successfully completing these tasks, the transition on MailStore Server is complete.
Source: [Changing Archiving from Microsoft Exchange Server to Microsoft 365 - MailStore Server Help](https://help.mailstore.com/en/server/index.php?title=Changing_Archiving_from_Microsoft_Exchange_Server_to_Microsoft_365)