Add both IMAP accounts to Thunderbird. Right-click any folder in the source account and choose Copy To, then pick the destination folder. For nested folder trees, install the free Copy Folder add-on. For large-scale selective migrations by date, folder name or message size, use imapsync from the command line with flags like --folder, --maxage and --exclude.
The Problem With Full-Mailbox Migrations
You are switching hosts. Or merging two accounts. Or archiving a decade of email from a retiring staff member. Whatever the reason, you do not want all of it. You want a specific set of folders. Maybe just the last two years. Maybe everything except Spam and Trash.
Most migration guides tell you to export everything and import everything. That is fine when you need everything. But when you need to be selective picking folders, filtering by date, skipping attachments over a certain size the standard advice breaks down fast.
This guide covers three methods: a quick GUI approach in Thunderbird, a folder-tree add-on for nested structures and a command-line tool called imapsync that handles anything the first two cannot. Pick the one that matches what you are trying to do.
This guide covers IMAP to IMAP only
All three methods require both accounts to support IMAP. POP3 accounts store mail locally and cannot be treated as a live server source in the same way. If you are working with POP3, archived MBOX files or PST exports, the workflow is different. Our MBOX Converter handles MBOX-sourced migrations separately.
Before You Start
Subscribe to all source folders in Thunderbird. IMAP folders only appear in Thunderbird if you have subscribed to them. Right-click the source account name and choose Subscribe. Check every folder you plan to copy. Missing folders are the single most common reason for incomplete migrations.
Enable IMAP on the destination account. Log into the destination account’s webmail settings and confirm IMAP access is turned on. Gmail, Outlook.com and most providers have IMAP disabled by default for new accounts created after 2023.
Note your folder counts before starting. In Thunderbird, right-click a folder and choose Properties to see the message count. Write down the count for each folder you plan to migrate. You will use this to verify the migration completed correctly.
Method 1: Thunderbird Drag-and-Drop (Best for Small Selections)
This is the simplest path and requires no extra tools. It works well when you need to move a handful of folders.
Add both accounts to Thunderbird. Go to File then New then Existing Mail Account. Add the source account first, then the destination account. Both should appear in the left-hand account list at the same time.
Right-click the folder you want to copy. In the source account, right-click the folder. Choose Copy To, then navigate to the destination account and select the target folder. Thunderbird uploads the messages to the IMAP server immediately.
Wait for synchronisation to complete. Watch the bottom status bar in Thunderbird. It shows the upload progress. Do not close Thunderbird or switch to another folder while the transfer is running. Large folders can take several minutes on slow connections.
Verify the count on the destination. Right-click the newly created folder in the destination account and choose Properties. Compare the message count against the number you noted from the source folder before starting.
Thunderbird 115 removed multi-folder selection
If you are running Thunderbird 115 (Supernova) or later, you can no longer select multiple folders at once in the folder pane. You must copy folders one at a time. If you have many folders to migrate, Method 2 or Method 3 will save you significant time. A bug report requesting the feature back is open at bugzilla.mozilla.org (bug 1817605).
Method 2: Copy Folder Add-On (Best for Nested Folder Trees)
The Copy Folder add-on adds one thing Thunderbird is missing out of the box: the ability to copy an entire folder tree, including all subfolders, to another account in a single operation. It is free and available directly from the Thunderbird add-ons directory.
Install the add-on. In Thunderbird, go to Tools then Add-ons and Themes. Search for “Copy Folder Mod” and click Add to Thunderbird. Restart Thunderbird when prompted.
Right-click the parent folder. In the source account, right-click the top-level folder containing all the subfolders you want to copy. You will now see a new Copy Folder option in the context menu.
Choose the destination. Select the destination account or a specific folder inside it. The add-on copies the full folder hierarchy recursively all subfolders and all messages preserving the original structure on the destination IMAP server.
Let it run. The add-on works in the background. If the destination folder already exists, it merges content rather than overwriting. Messages that already exist at the destination are not duplicated.
The Copy Folder add-on is the right choice when your source account has a deep nested structure (Projects/Client-A/2024/Invoices, for example) and you want to preserve that structure exactly on the destination account without copying folder by folder manually.
Method 3: imapsync (Best for Large-Scale Selective Migrations)
imapsync is an open-source command-line tool built specifically for this job. It processed 247 million mailbox transfers in 2025 and supports every major IMAP server including Gmail, Outlook.com, Office 365, Yahoo and any cPanel or Dovecot server. It is the right tool when you need date filters, size limits, folder exclusions or you are migrating more than a few dozen gigabytes.
How Do You Install imapsync?
On Ubuntu or Debian:
| OS | Install Command |
|---|---|
| Ubuntu / Debian | sudo apt-get install imapsync |
| macOS (Homebrew) | brew install imapsync |
| Windows | Download imapsync.exe from imapsync.lamiral.info and run from Command Prompt |
The latest release as of this writing is 2.314 (September 2025). Always download from the official site at imapsync.lamiral.info to get the current version.
What Does a Basic imapsync Command Look Like?
The core command connects to both IMAP servers and mirrors every folder from source to destination:
| Part | What It Does |
|---|---|
--host1 |
Hostname of the source IMAP server |
--user1 / --password1 |
Source account credentials |
--host2 |
Hostname of the destination IMAP server |
--user2 / --password2 |
Destination account credentials |
A full basic command looks like this:
imapsync \
--host1 imap.oldhost.com --user1 you@oldhost.com --password1 yourpassword \
--host2 imap.newhost.com --user2 you@newhost.com --password2 yourpassword
This copies every folder and every message. Read the next section before running this you almost certainly want to add filters.
How Do You Make the Migration Selective?
This is where imapsync earns its place. Add any of these flags to filter exactly what gets copied:
Copy a specific folder only. Add --folder "INBOX/Projects" to copy just that folder and nothing else. Use multiple --folder flags to include more than one.
--folder "INBOX/Projects" --folder "INBOX/Archive"
Exclude Spam, Trash and Junk. Add --exclude with a regex pattern. This saves significant time and avoids filling the destination account with unwanted mail.
--exclude "Trash|Junk|Spam|Deleted"
Migrate only the last year of email. Use --maxage 365 to skip any message older than 365 days. Combine with --minage 7 to also skip messages newer than 7 days if you want a middle window.
--maxage 365
Skip large attachments. Add --maxsize 25000000 to skip messages larger than 25 MB. Useful when the destination server has a per-message size limit.
--maxsize 25000000
A complete selective migration command combining all of the above:
imapsync \
--host1 imap.oldhost.com --user1 you@oldhost.com --password1 yourpassword \
--host2 imap.newhost.com --user2 you@newhost.com --password2 yourpassword \
--exclude "Trash|Junk|Spam" \
--maxage 730 \
--maxsize 25000000
This migrates the last two years of email from all folders except Trash, Junk and Spam and skips any single message larger than 25 MB.
Always Run a Dry Test Before the Real Migration
Add --dry to simulate the migration without transferring anything. imapsync walks through every folder and reports what it would do how many messages match, which ones would be skipped and why without writing a single byte to the destination server.
imapsync \
--host1 imap.oldhost.com --user1 you@oldhost.com --password1 yourpassword \
--host2 imap.newhost.com --user2 you@newhost.com --password2 yourpassword \
--exclude "Trash|Junk|Spam" \
--maxage 730 \
--dry
Run the dry test. Read the output. Confirm the numbers make sense. Then remove --dry and run the real migration. Skipping this step is the most common reason migrations end up with unexpected results.
imapsync is incremental by default
You can stop and restart imapsync at any time. It compares messages on both servers using headers and does not re-transfer anything already present at the destination. For large mailboxes over a slow connection this matters you can run it in stages across multiple sessions without generating duplicates.
Which Method Should You Use?
| Situation | Best Method |
|---|---|
| Copying 1 to 5 folders, no subfolders | Thunderbird drag-and-drop (Method 1) |
| Copying a deep folder tree with subfolders | Copy Folder add-on (Method 2) |
| Migrating by date range, excluding folders or size limits | imapsync (Method 3) |
| Migrating a full mailbox cleanly, tens of thousands of messages | imapsync (Method 3) |
| No command line access, Windows only | Method 1 or Method 2 or imapsync.exe on Windows |
| Migrating dozens of accounts (IT admin) | imapsync with a shell script loop (Method 3) |
Common Problems and How to Fix Them
--syncinternaldates to the imapsync command. This is on by default in most versions but some server configurations override it. Adding it explicitly forces imapsync to preserve the original arrival date.--maxage to migrate in date-based chunks.Frequently Asked Questions
Does Thunderbird support copying folders between two different IMAP accounts?
Yes. Add both accounts in Thunderbird (File then New then Existing Mail Account), subscribe to all folders in the source account and then right-click any folder to get the Copy To option. The folder is uploaded directly to the destination IMAP server. In Thunderbird 115 and later you can only select one folder at a time multi-folder selection was removed in that release.
What is the difference between Copy To and Move To in Thunderbird?
Copy To duplicates the messages to the destination and leaves the originals in the source account untouched. Move To uploads to the destination and deletes from the source. For migrations where you want to keep the source intact as a backup, always use Copy To. Use Move To only when you are sure the source can be cleaned up after verification.
Does imapsync preserve read/unread status, flags and folder structure?
Yes to all three. imapsync preserves IMAP flags including read, unread, starred and deleted status. It also recreates the full folder hierarchy at the destination, including nested subfolders. Folder structure is one of the main reasons to use imapsync over a manual drag-and-drop approach for large mailboxes.
Can I migrate only emails from the last 12 months?
Yes. Use imapsync with --maxage 365. This skips any message whose internal date is older than 365 days. If you also want to exclude very recent messages for example keeping a cut-off of one week ago add --minage 7 as well. The two flags can be combined to select any date window you need.
What happens if I stop imapsync mid-transfer?
Nothing is lost. imapsync is incremental by design. When you restart the command it compares headers on both sides and skips any message already transferred. You will not get duplicates. This makes it safe to run imapsync overnight, interrupt it and resume the next day useful for large mailboxes over slow or unreliable connections.
Will this work with Gmail, Office 365 and other hosted providers?
Yes. All three methods work with any provider that supports standard IMAP. Gmail requires you to enable IMAP under Settings and use an app-specific password (regular passwords are blocked for IMAP since 2022). Office 365 requires IMAP to be enabled either by the account owner or by an IT administrator through the Exchange admin center.
Conclusion
Last verified: May 2026. Methods tested against Gmail, Outlook.com and cPanel-hosted Dovecot servers. imapsync version 2.314 used for command-line examples. Thunderbird version tested: 128 (Supernova).
Selective IMAP migration is not complicated once you know which tool fits the job. Thunderbird’s built-in Copy To covers small selections. The Copy Folder add-on handles nested trees. And imapsync gives you precise control by folder, by date, by size for anything larger or more specific.
Trust me on the dry run. Running imapsync with --dry first takes two minutes and has saved a lot of people from migrating 10 years of Spam to a new inbox. Do the test, read the output and then let it run for real.
For large enterprise migrations covering hundreds of mailboxes or situations where you need a full audit trail of what moved and what did not, take a look at our professional email migration service. And if you are working with archived MBOX files rather than live IMAP accounts, the MBOX Converter covers that path.
Which method did you end up using Thunderbird, the add-on or imapsync? And what was the trickiest part of your migration setup?