Email Migration Guide
How to export your existing emails and import it into your Hustly email service
Moving your email service does not mean losing your existing messages. This guide explains how to export your current mailboxes as MBOX files, split large files when necessary, update your email DNS records, and finally import your existing email into your Hustly email service.
Important: export your email before changing DNS
Complete Step 1 and Step 2 before changing your email DNS or MX records. This ensures that your existing messages are safely exported while your old email service is still available.
Step 1: Export your existing email as MBOX
The easiest method is to use Mozilla Thunderbird. Thunderbird works on Windows, macOS and Linux and, with the ImportExportTools NG extension, can export individual email folders directly into MBOX files.
Recommended: Export using Thunderbird
1. Install Mozilla Thunderbird on your computer.
2. Add your existing email account to Thunderbird using your current email provider’s IMAP settings.
3. Allow Thunderbird to fully synchronize your mailbox before continuing.
Make sure that messages in folders such as Inbox, Sent, Drafts, Archive and any custom folders are visible before exporting.
4. Install the ImportExportTools NG extension in Thunderbird.
5. To export your entire email account while retaining its folder structure, right-click the email account and open ImportExportTools NG. Choose Export Account.
Alternatively, to export a specific folder and its subfolders, choose Folder Export (mbox) → Structured With Subfolders. This preserves folders such as Inbox, Sent, Archive and custom subfolders instead of requiring you to export each one manually.
6. If you only want to export individual folders, right-click the required folder and use the ImportExportTools NG export option to export it in MBOX format. Repeat this for each folder you want to migrate.
Depending on the method you choose, you will either have a structured export containing your folders and subfolders, or individual MBOX files for folders such as Inbox, Sent and Archive.
Before continuing
Open Thunderbird and check that all of the messages you expect to migrate are present. Do not rely on an export made while Thunderbird is still downloading older messages.
Using Apple Mail on macOS
Apple Mail can also export mailboxes in MBOX format.
1. Open Apple Mail.
2. Select the mailbox you want to export.
3. Select Mailbox > Export Mailbox.
4. Save the exported mailbox somewhere safe on your Mac.
Apple Mail exports mailboxes as MBOX packages. If you prefer the simplest possible workflow for the later Roundcube import, Thunderbird is generally easier because you can export the folders directly for this purpose.
What about Outlook?
Outlook is less convenient for this migration because it does not normally export email directly to MBOX.
- Outlook for Windows normally exports mail to a PST file.
- Legacy Outlook for Mac exports an OLM archive.
- Roundcube cannot directly import PST or OLM files as MBOX.
If your existing mailbox is currently configured in Outlook, the easiest solution is usually to also configure the same account in Thunderbird using IMAP, allow it to synchronize the mailbox, and then perform the MBOX export from Thunderbird.
Keep your exported files safe
The exported MBOX files contain your actual email messages and attachments. Keep a copy of them until the migration is completely finished and you have confirmed that your messages are available in the new mailbox.
Step 2: Check the size of your MBOX files
Before importing your messages into Roundcube, check the size of each exported MBOX file.
Is your MBOX file smaller than 50MB?
You can skip the splitting section. Continue directly to Step 3: Update your email DNS records.
If an MBOX file is larger than 50MB, split it into smaller MBOX files before importing it.
Do not simply cut the file into pieces using a normal file-splitting utility. An MBOX file contains complete email messages, and splitting it at an arbitrary byte position can cut an email in half and corrupt the resulting files.
Instead, use the script below. It splits the mailbox between complete messages.
Use an MBOX splitter app if you prefer
The easiest option is to use an MBOX splitter application that can split large MBOX files into smaller files while preserving complete email messages.
Some available options include:
- MBOX Splitter
- MBOX Splitter for macOS (Mac App Store)
- MBOX File Splitter
- MBOX Splitter for Windows (Microsoft Store)
Set the output size to below 50MB per file. If you do not want to use a splitter application, you can use the Python script below.
Do not use a generic file-splitting utility that simply cuts the file at a fixed byte size. MBOX files contain complete email messages, and splitting one at an arbitrary position can cut a message in half and corrupt the resulting files.
Split a large MBOX file into smaller files
Save the following script as split_mbox.py:
#!/usr/bin/env python3
import sys
import mailbox
import os
# Keep files slightly below 50MB to allow a safety margin.
MAX_SIZE = 49 * 1024 * 1024
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} mailbox.mbox")
sys.exit(1)
input_file = sys.argv[1]
if not os.path.isfile(input_file):
print(f"File not found: {input_file}")
sys.exit(1)
base_name, _ = os.path.splitext(input_file)
source = mailbox.mbox(input_file)
part_number = 1
current_size = 0
output = None
output_name = None
for message in source:
message_data = message.as_bytes(unixfrom=True)
# Ensure a blank line separates messages in the MBOX file.
if not message_data.endswith(b"\n"):
message_data += b"\n"
message_data += b"\n"
message_size = len(message_data)
if output is None or (
current_size > 0 and
current_size + message_size > MAX_SIZE
):
if output:
output.close()
output_name = (
f"{base_name}_part_{part_number:03d}.mbox"
)
print(f"Creating {output_name}")
output = open(output_name, "wb")
current_size = 0
part_number += 1
output.write(message_data)
current_size += message_size
if output:
output.close()
print("Done.")
On macOS or Linux, run:
chmod +x split_mbox.py
./split_mbox.py Inbox.mbox
Alternatively:
python3 split_mbox.py Inbox.mbox
The script will create files such as:
Inbox_part_001.mbox
Inbox_part_002.mbox
Inbox_part_003.mbox
Each complete email remains intact. The script starts a new file when adding the next message would take the current file above approximately 49MB.
A very large individual email
The script never splits an individual message. If a single email by itself is larger than the import limit, that individual MBOX part may therefore still be larger than 50MB.
Step 3: Update your email DNS records
Once your existing email has been safely exported, you can change the DNS records for your domain so that new email is delivered to your new email service.
Configure your email DNS records
Follow our separate guide to update the required MX and other email DNS records.
Do not immediately delete your old mailbox
DNS changes can take time to propagate. Keep your old email service active while the DNS change is taking effect, and check the old mailbox for any messages that may have arrived during the transition.
Once the DNS records are active, sign in to your Hustly web mail interface (Roundcube) and confirm that the new mailbox can send and receive email before importing your old messages.
Step 4: Import your MBOX files into your Hustly web mail interface (Roundcube)
The web mail interface (Roundcube) can import MBOX files directly into an email folder.
Import your messages
1. Log in to web mail (Roundcube). Your default web mail URL is of the format: webmail.box[number].hustly.email
2. Select the folder where you want the old messages to be imported.
For example, select Inbox before importing your Inbox MBOX file.
3. Open the folder actions menu and select Import messages.
4. Select your MBOX file from your computer.
5. Upload the file and allow the web mail interface (Roundcube) to complete the import.
6. Repeat the process for your other mail folders.
If you split a large mailbox
Import each part into the same web mail (Roundcube) folder.
For example:
Inbox_part_001.mbox
Inbox_part_002.mbox
Inbox_part_003.mbox
should all be imported while the Inbox folder is selected.
Likewise, if you exported your Sent mailbox separately, select your Sent folder in web mail (Roundcube) before importing its MBOX file or files.
Migration complete
After the import finishes, check several folders and messages to confirm that your old email and attachments are present. Keep your original MBOX exports until you are satisfied that the migration has completed successfully.
Migration checklist
✓ Export all required email folders before changing DNS.
✓ Confirm that Thunderbird or your email client has fully synchronized your old mailbox.
✓ Keep MBOX import files below 50MB where required.
✓ Split large MBOX files only at message boundaries.
✓ Update your domain’s email DNS records.
✓ Confirm the new mailbox can send and receive email.
✓ Import each MBOX file into the correct Roundcube folder.
✓ Keep the old mailbox and your exported files until the migration has been verified.
Need help with your email migration?
If you have questions about configuring your new mailbox, changing your email DNS records or importing your existing messages, please contact Hustly support.