Migrating multiple mailboxes at once with a CSV file

If you have several mailboxes to move, you can set them all up in one upload instead of filling in the form for each one. Each row of a CSV file is one migration. This article covers the file, the upload, and the batch page. Everything else (what's supported, sync modes, following and re-running a migration) works the same as for a single mailbox, and is covered in Migrating your email with the Imapsync Migration Tool.

Contents

  1. Before you start
  2. Prepare your CSV file
  3. Passwords with commas, quotes or spaces
  4. Upload and check the preview
  5. The batch page
  6. CSV upload errors

Before you start

Check the steps in Before you start in Migrating your email with the Imapsync Migration Tool for every mailbox in your file. In particular, every new mailbox must already exist, and every old mailbox must allow IMAP access.

LimitValue
Rows per upload100
File size1 MB
File formatCSV saved as UTF-8

More than 100 mailboxes? Split them across several files and upload each one separately. Each upload becomes its own batch. Only two migrations run at the same time, so the rest wait as Scheduled and start by themselves.

Bulk migrations always use Sync All, plus any flags a row has. When a file is uploaded, the rest of the form (server details, passwords, sync mode and advanced options) is ignored.


Prepare your CSV file

The file has seven columns, in this order:

ColumnWhat goes in itRequired
src_hostOld mail server, for example hostold.domain.tld.Yes
src_emailThe old mailbox address.Yes
src_passwordThe old mailbox password (or app password).Yes
dest_hostYour MyHost mail server, for example hostnew.domain.tld.Yes
dest_emailThe new mailbox, which must already exist.Yes
dest_passwordThe new mailbox password.Yes
extra_flagsExtra options for this row only, for example --maxage 30. Leave empty if not needed.No

A header row is optional: it is detected and skipped. Only the flags in a row are used for that row.

src_host,src_email,src_password,dest_host,dest_email,dest_password,extra_flags
hostold.domain.tld,user_old@domain.com,ExamplePassword1,hostnew.domain.tld,user_new@domain.com,ExamplePassword2,
hostold.domain.tld,user_old2@domain.com,ExamplePassword3,hostnew.domain.tld,user_new2@domain.com,ExamplePassword4,--maxage 30

Gmail mailboxes need --gmail1 in their row. A bulk migration only uses the flags in each row, so put --gmail1 in extra_flags for every Gmail row, and use an app password as src_password. Without it, Gmail mail is copied two or three times. Read Migrating your email from Gmail for how to create the app password.

imap.gmail.com,user_old@gmail.com,abcdefghijklmnop,hostnew.domain.tld,user_new@domain.com,ExamplePassword2,--gmail1

Download CSV Template on the form gives you a ready-made file to fill in.

The Bulk Migration panel with the CSV format box, the template link and the file field

Editing the file in Excel

Excel is the most common cause of a broken CSV file. It can save the file in the wrong format and change values it thinks are mistakes.

  • When saving, choose CSV UTF-8 (Comma delimited). Plain CSV (Comma delimited) is not UTF-8, and names or passwords with special characters come out garbled.
  • Check passwords after saving. Excel can change some characters, such as straight quotes into curly quotes.
  • If you can, edit the file in a plain text editor instead.

Whatever you use, the preview after upload shows exactly what was read, so you can check it there (see Upload and check the preview below).


Passwords with commas, quotes or spaces

Most passwords can be typed straight into the file. Two characters need care, because CSV uses commas to separate columns and double quotes to group text.

If the password containsWrite it in the CSV as
a comma, for example pa,ss"pa,ss"
a double quote, for example pa"ss"pa""ss" (wrap the password, and type the inner quote twice)

  • Double quotes are the only wrapper the tool recognises. Single quotes become part of the password: 'password123' is saved with the apostrophes.
  • Spaces are kept exactly as typed. In ...,user@old.com, pass ,mail.new.com,... the password is pass , with a space at each end. Don't add spaces around a password unless they are part of it.
  • Server names and email addresses have spaces trimmed automatically. Passwords are left untouched.

Not sure you got it right? Upload the file and use Show passwords in the preview to check each one.

The password formatting help expanded, with the comma and double quote examples


Upload and check the preview

  1. Open the New Email Migration form and expand Bulk Migration.
  2. Under Upload CSV File, click Choose File and pick your file.
  3. The preview shows "N migrations ready" and one row per migration.
  4. Click Show passwords to check every password came through exactly. Click it again to hide them.
  5. Fix any mistake directly in the table, or remove a row you don't want. If you edit a password here, type it plainly: the quoting rules are only for the file.
  6. Click Validate Rows to check every row is filled in correctly.
  7. Click Test All Credentials to log in to both mailboxes for every row. To test one row only, click its status.
  8. If you might run the batch again, tick Store passwords for one-click re-runs. It applies to every row.
  9. Click Start Migration.

Rows the tool cannot read are listed in a yellow warning above the table.

The preview of two example rows, saying 2 migrations ready

The same preview with the placeholder passwords revealed

Three rows after Test All Credentials, all verified

Start Migration always checks the format of every row first, even if you skipped Validate Rows. If a row has a problem, nothing starts. A red summary appears, for example "2 row(s) failed validation. Fix the entries below and re-upload.", and each bad field shows its own message. Fix them in the table and click Start Migration again.

A two-row file that fails validation, with the red summary and each field's error


The batch page

A successful upload opens the batch page. It shows the Batch reference (for example BAT-12345-ABC), how many Migrations scheduled, whether Passwords stored is Yes or No, and a table of the migrations in the batch.

The batch page with the batch reference, the count scheduled, the passwords stored value and three migrations

Each migration in the batch has its own status and page, and works like a single migration. To follow one, click its Description. On the Email Migrations page, the whole batch shows as one Batch row.

If some rows were rejected, the page says "N of M migrations were scheduled. See the failed rows below." and lists them under Rows that couldn't be scheduled, with the CSV row number and the Error for each. Fix those rows and upload a new file with only them.

Re-run Batch runs every migration in the batch again, once they have all finished. It only works for migrations whose passwords were stored and have not expired. Any others are skipped: use Clone on each of those and type the passwords again.


CSV upload errors

What the form saysWhat to do
"The uploaded file is empty. Please check your CSV and try again."Check you picked the right file, then upload it again.
"The CSV file does not contain any data rows. Please add at least one migration."Add at least one row under the header.
"This upload has N migrations. A maximum of 100 are allowed per upload: remove some rows or split the file into smaller ones."Split the file into several files of up to 100 rows.
"The uploaded file is too large. Maximum size is 1 MB."Split the file into smaller files.
"The CSV file could not be processed. Please check its contents and try again."Check there are seven columns and the quoting rules above, save as CSV UTF-8, and upload again.
"No migrations were scheduled because every row failed validation - row N: <reason>; ... Fix these rows and try again."Fix the rows listed, then upload again.

Strange characters in the preview? If names, addresses or passwords show odd symbols, the file was not saved as UTF-8. The rows then fail with errors such as "Email local-part contains invalid characters". Save the file again as CSV UTF-8 (Comma delimited) and upload it again.

A 101-row upload showing 101 migrations ready and the red message about the 100-row limit

A file in the wrong encoding, with a garbled old email address and a red validation summary

Problems after the migrations start are covered in Troubleshooting email migrations.


Related articles

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to use Advanced Options when migrating emails

The Imapsync Migration Tool has a selection of Advanced Options available for you to use when you...

Migrating your email account from Gmail

The Imapsync Migration Tool can copy your email from a Gmail mailbox into your MyHost mailbox....

Troubleshooting your Email Migration

This article helps you understand the message on a failed migration and fix what caused it...

Migrating your email account to MyHost

The Imapsync Migration Tool copies your email from your old provider into your MyHost mailbox,...