Posted on

Migrate IMAP mailboxes to Microsoft 365 – Office 365 – Exchange online

Here are the steps required in sequence to migrate an IMAP domain to Exchange Online.

  1. Add the domain to your Microsoft 365 tenant. You don’t have to complete the mail server setup.
  2. Add domain users to Microsoft 365. Each user must have a Microsoft 365 Business Basic, Standard, or Premium license
  3. Prepare the csv file for migration, separated by commas. In the first line put EmailAddress, UserName, Password. In the following lines the data: “EmailAddress is the Microsoft account,” UserName “is the imap server account and” Password “is the imap server password

example of csv

EmailAddress,UserName,Password
terrya@contoso.edu,contoso\terry.adams,1091990
annb@contoso.edu,contoso\ann.beebe,2111991
paulc@contoso.edu,contoso\paul.cannon,3281986
  1. Log in as an administrator in Microsoft 365 and go to the Exchange admin center. (Note: this guide is for the “classic” Exchange administration interface. Select “recipients” on the left; select “migration” at the top.
  2. At the center of the page there is a button with three dots: …. Selecting it, the endpoint is inserted, that is the Imap source server. In the next window add the new endpoint (IMAP).
  3. Create a new migration. launch the migration
  4. once the migration is complete, in the tenant, you can finish configuring the domain for what concerns the mail server, following the instructions on the tenant and changing your dns

The Rules of Migration

You can put all users in a migration. When a migration ends in error, you can delete a user from it and put the same user in another migration. You can have multiple migrations at the same time but the same user cannot exist in more than one migration. Migration can exist for up to 60 days.

It is not a migration

In reality, Microsoft does a more sophisticated operation than a “trivial” migration: it makes a sync. Synchronize entire imap mailbox to Exchange mailbox in one direction (from imap to exchange). It is sophisticated but less effective than a normal migration: it is not in real time but after 24/30 hours. So if you want to replace the mail server, users would lose at least 24 hours of email.

Configuring perspectives

On Outlook clients, you can add the new Exchange account online. It will be the same as the old mailbox, but will be managed by Exchange. For a while you will then have 2 mailboxes that manage the same mail but on different servers: one is the old imap server, the other one the new Exchange server. When the migration is finished and you have also moved the mx records on the dns, you can delete the old mailbox. Before doing this, however, you must also memorize the contacts and the calendar from the “old” to the “new”:

Contacts: select all contacts, right click, select “move” and then “copy to folder …”, Exchange mailbox contacts.

Calendar: To move appointments between 2 calendars: both calendars and drag appointments from old to new.

Problems in migration

If you have any problem you can investigate using PowerShell. First install ExchangeOnlineManagement.

Connect to the tenant:

Connect-ExchangeOnline -UserPrincipalName <your Admin Username>

The password request screen appears.

List of all endpoints in the tenant

get-migrationendpoint|FL

endpoint test

Test-MigrationServerAvailability -Endpoint <Identity of the endpoint from above>

view sync configuration of single user

Get-SyncRequest -Mailbox  <user>

esport migration result for a user

Get-MigrationUserStatistics <user> -IncludeSkippedItems -IncludeReport 
-DiagnosticInfo "showtimeslots, showtimeline, 
verbose" | Export-Clixml C:\temp\MigMyUser.xml

Exchange mailboxes have a 35MB limit. If you have to move something bigger during the migration you have to change this limit.

Set-Mailbox -Identity <user> -MaxReceiveSize 150MB

Documentation:

Posted on

wordpress error on qtranslate switching from php 5 to php 7

Switching from php 5 to php 7, you will get this error on the qtranslate X plugin

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /public_html/wp-content/plugins/qtranslate-x/qtranslate_frontend.php on line 497

Warning: Parameter 2 to qtranxf_postsFilter() expected to be a reference, value given in /public_html/wp-includes/class-wp-hook.php on line 286

Solution

Using ftp open the file qtranslate-x/qtranslate_frontend.php. you need to make 3 substitutions :

  • In line 497 change
continue;

to

break;
  • In line 523 change
function qtranxf_postsFilter($posts,&$query) {//WP_Query

to

function qtranxf_postsFilter($posts,$query) {//WP_Query
  • in line 597 change
function qtranxf_excludeUntranslatedPosts($where,&$query) {//WP_Query

to

function qtranxf_excludeUntranslatedPosts($where,$query) {//WP_Query
Posted on

Speed of a remote backup

To build a backup environment it is recommended to follow the 3-2-1 rule.

  • Make 3 backups
  • Make 2 backups on different media
  • Make 1 backup in another location than the source data

To carry out the third tip, we very often think of the Cloud; it’s a great solution but the costs are still quite high if we need to move TB. If, on the other hand, we have to save some GB, the solution is attractive.

For companies that need to move TB of data, a solution can be backup to a remote location, for example connected with a vpn. The costs of saving the data will therefore be absorbed by the purchase costs of a fairly large NAS unit.

Let us try to detail such a solution.

Backup speed in vpn

The speed of the backup will be determined by the slowest internet connection speed between the 2 locations. Let’s suppose that the 2 offices are able to communicate at the speed of 300 Mb / s.

300 Mb / s = 300,000,000 b / s

300,000,000 b / s / 8 = 37,500,000 b / s = 37.5 MB / s

To move 1GB of data over a 300 Mb / s network, it will take 1,000 / 37.5 = 26.7 seconds

To move 1GB of data over a 100 Mb / s network, it will take 1,000 / 12.5 = 80 seconds

Backup software all have the ability to perform incremental backups but the first backup that is performed will inevitably be very long. So it needs to be planned carefully.

If we want to move a 20GB virtual machine across a 300 Mb / s network, it will take about 27 minutes. It will take us 2 hours and 15 minutes for a 1TB virtual machine. The incremental backups of the various software on the market, in “normal” conditions of server activity, allow subsequent backups to arrive at times equal to 20% of the first backup.

Choice of Backup NAS

The source site data is stored on Nas at the destination site. It is clear that choosing a NAS equipped with a 10Gb / S ethernet card does not improve our remote backup since the transfer speed of the vpn is less than 1Gb / s.

Could the NAS disks further decrease the copy speed? To answer this, let’s take a look at a table that tries to give a value to the write speeds of the various disk systems. We took the data from the wikipedia site and then processed it.

Drive

(Type / RPM )

MB/s

(64KB block, random)

MB/s

(512KB block, random)

MB/s random

average

MB/s

(large block, sequential)

MB/s sequenzial

average

FC / 15 K 9.7 – 10.8 49.7 – 63.1 33,3 73.5 – 127.5 100,5
SAS / 15 K 11.2 – 12.3 58.9 – 68.9 37,8 91.5 – 126.3 108,9
FC / 10 K 8.3 – 9.2 40.9 – 53.1 27,9 58.1 – 107.2 82,65
SAS / 10 K 8.3 – 9.2 40.9 – 53.1 27,9 58.1 – 107.2 82,65
SAS/SATA / 7200 4.4 – 4.9 24.3 – 32.1 16,4 43.4 – 97.8 70,6
SATA / 5400 3.5 22.6 13,05 47,1 (estimate)
SSD 520 520

Backup software normally writes disks sequentially, so numbers in hand, even a sata 5400 hard drive could be useful in our scenario. Buying hard drives above 7200 rpm, on the other hand, would not lead to an improvement.

Posted on

Register a web application with Azure AD Portal App Registration to connect to a Microsoft 365 tenant

PowerShell Limits

Through Powershell it is possible to connect to a Microsoft 365 tenant to perform operations on users, groups and any other element of the tenant. When you use this tool, Powershell presents you with the mask for entering your account and password. You can write accounts and passwords directly in the Powershell script but it would be a serious security compromise.

Application

An alternative is to build a software that connects directly to the Tenant through customized keys present in the Tenant itself. In other words, it is necessary to communicate to the Tenant that there is a certain application that is authorized to access the Tenant. Furthermore, for each operation that you want to perform on the Tenant it is necessary to specify the appropriate permissions. To create these applications, we recommend that you follow the excellent tutorial “.Net Core console application for calling Microsoft Graph“.  This post proposes the images present in the previous tutorial only to specify how the application must be prepared on the Microsoft Tenant.

Register a web application with Azure AD Portal App Registration

Open a browser and navigate to the Azure Portal. Login using your account. Select the resource “Azure Active Directory”. On the left side menu, select “App regitstration”. Click New registration from the current page.

On the Register an application page, specify the following values:

  • Name = Name of your Application
  • Supported account types
  • Redirect URI
    • Type = Web
    • Value = https://localhost:8080   (*)

(*) The Redirect URI value must be unique within your domain. This value can be changed at a later time and does not need to point to a realy hosted URI.

It is now necessary to store 2 values that will be used in your application:

  • Application (client) ID
  • Directory (tenant) ID

Certificates & secrets

Click Certificates & secrets.

  1. Click New client secret.
  2. On the Add a client secret dialog, specify the following values:
    • Description = Your secret’s description
    • Expires = In 1 year (for example)
  3. Click Add.

After the screen has updated with the newly created client secret copy the VALUE of the client secret. This secret string is never shown again, so make sure you copy it now.

API permissions

Click API permissions.

  • Click Add a permission
  • On the Request API permissions panel select Microsoft Graph.

  • Select Application permissions.

Now you have to choose between the permissions to authorize your app. For example, to create an application to read alla information about Tenant’s users, in the “Select permissions” search box type “User”.Select User.Read.All from the filtered list. At the end, on the API permissions content blade, click Grant admin consent for the Tenant.

Summary of the data necessary for the application

Let’s see what data your application needs to connect and operate on the Microsoft Tenant.

  • applicationId = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”;
  • applicationSecret = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”;
  • tenantId = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”;
  • redirectUri = “https://localhost:8080”;
  • domain = “yourtenant.onmicrosoft.com”;

Permissions

  • User.Read.All : Read all users’ full profiles
  • User.ReadWrite.All : Read and write all users’ full profiles
  • Group.ReadWrite.All : Read and write all groups
  • Notes.ReadWrite.All : Read and write all OneNote notebooks

Documentation

Posted on

Apache on Windows – AH00072: make_sock: could not bind to address [::]:80

Scenario

On your Windows computer, Apache does not start. Go to the event viewer and find the event with error:

AH00072: make_sock: could not bind to address [::]: 80

Problem

The problem is that an application is using the same port 80 as your site on Apache. How to find out what this application is?

Open the command prompt (cmd). Type

netstat -ano

You see all open ports on your computer used by applications. Find the line that (in this case) is about port 80. The PID column shows the number of the program that is using your port.

Open task manager, in the tab “Details” through the PID column you will find the program that is using your port.

Solution

You have 2 possibilities: either stop the program or, if you need the program, change the port used by this program, if possible, or the one used by Apache.

If the program you found through the PID is System, it means that Windows itself is blocking the door. Open the services and you need to stop the “World Wide Web Publishing Service” service. You will also have to set the start in manual, if instead it were in Automatic, because otherwise the next day the problem would reoccur.

Posted on

Move a mysql – mariadb database from one windows server to another windows server

Install xampp on the new server and If mysql is on, turn it off.

In the folder C: \ xampp \ mysql \ data create a new folder, for example with the name of the database you are moving.

Copy in it all the data files (.frm, .ibd, .myd, .myi) from the relative folder of the old server.

Make a copy in a backup folder of the file ib_logfile0, ib_logfile1, ibdata1 those are in the folder “C: \ xampp \ mysql \ data” in the new server.

Copy the files ib_logfile0, ib_logfile1, ibdata1 from the old server to the same location as the new server, i.e. in the folder C: \ xampp \ mysql \ data

Start mysql. Open a dos prompt, go to the directory

cd C: \ xampp \ mysql \ bin

mysql -u root -p

show databases;

You should see the new database added to the previous ones.

Open another dos prompt and check the tables with the commands

cd C: \ xampp \ mysql \ bin

mysqlcheck -uroot -p YOURDATABASE

Open your browser and connect to phpmyadmin with http: // localhost / phpmyadmin

You should see the database and tables.