need assistance migrating dovecot mailboxes to new server

Posted on 2013-12-30
Last Modified: 2014-01-13
I am retiring a MAC-Mini server, running Lion and need to migrate a few mailboxes to the a new MAC-Mini, running Mavericks.

The mailbox path/structure and user IDs are different between the two.

Here is what I have for layouts and IDs:

(Old Server)

Each mailbox is located in the following location:


drwx------  20 ray                       mail  680 Dec 27 07:47 0673B754-B555-4582-9788-1905B39BD1CF
drwx------   9  mail  306 Dec  1  2011 54EFD52E-6A89-44A7-9126-1140E195B5E4
drwx------  10 raymond                   mail  340 Jan 28  2013 59F4C957-2BC1-4B3D-B21B-767FE2960746
drwx------   9 ical_server               mail  306 Nov 18 11:40 C6BECE93-A7DC-4840-9B08-033C01792DB6
drwx------  22 pete                      mail  748 Dec 30 10:17 C9048DCC-1346-4993-A877-99369050D86F
drwx------  11 _calendar                 mail  374 Nov 20 11:20 FFFFEEEE-DDDD-CCCC-BBBB-AAAA0000005D

Example of folders and files within each mailbox folder:

ls -a /private/var/spool/imap/dovecot/mail/C9048DCC-1346-4993-A877-99369050D86F
.                        .mailJunk                  dovecot.index.cache
..                        .mailTrash                  dovecot.index.log
.Deleted Messages            cur                        maildirsize
.Drafts                        dovecot-keywords            new
.Junk                        dovecot-uidlist                  subscriptions
.Notes                        dovecot-uidvalidity            tmp
.Sent Messages                  dovecot-uidvalidity.4ed7ff04
.Trash                        dovecot.index

Usernames with IDs

peteroyer                       507 (pete mailbox)
raymond                         501

New Server layout:

Path to mail boxes


ls -l

drwx------  2 _dovecot  mail     68 Dec 17 15:36 cur
-rw-------  1 _dovecot  mail      0 Dec 17 15:36 dovecot-acl-list
-rw-------  1 _dovecot  mail    105 Dec 17 15:36 dovecot-uidlist
-rw-------  1 _dovecot  mail      8 Dec 17 15:36 dovecot-uidvalidity
-r--r--r--  1 _dovecot  mail      0 Dec 17 15:36 dovecot-uidvalidity.52b0c3d3
-rw-------  1 _dovecot  mail    648 Dec 17 15:36 dovecot.index.cache
-rw-------  1 _dovecot  mail    456 Dec 17 15:36 dovecot.index.log
-rw-------@ 1 _dovecot  mail  18432 Dec 17 15:36 dovecot.skindex
-rw-------  1 _dovecot  mail      0 Dec 17 15:36 dovecot.sklock
-rw-------  1 _dovecot  mail      0 Dec 17 15:36 maildirfolder
-rw-------  1 _dovecot  mail     10 Dec 17 15:36 maildirsize
drwx------  3 _dovecot  mail    102 Dec 17 15:36 new
drwx------  2 _dovecot  mail     68 Dec 17 15:36 tmp

pete                       502
ray                        504
raymond                    501

My goal is to import the existing mailboxes to the new server and make necessary changes to files and folders for proper permissions and new user IDs
Question by:tamray_tech
  • 3
LVL 28

Expert Comment

by:Jan Springer
ID: 39746499
when i've migrated (linux not osx but similar), i

1) create all accounts on the new machine
2) tar each individual account directory (getting all subdirectories)
3) tar any generic mail directory
4) transfer and verify a few accounts

then i schedule a downtime (shut off your MTA and dovecot), re-tar and transfer the data.

Author Comment

ID: 39751599
Tried that, but I believe there is an issue with the database. In the following list of messages, only those sent today are displayed in the users mail client. I need all folders and messages to show up.  All permissions are correct on the files below:

mail-2:cur root# ls -l
total 128
-rw-------  1 _dovecot  mail   1398 Dec 17 14:32 1387312359.M31044P45445.mail.domain,S=1398,W=1428:2,ST
-rw-------  1 _dovecot  mail  34941 Dec 19 08:09 1387462178.M552894P10083.mail.domain,S=34941,W=35349:2,ST
-rw-------  1 _dovecot  mail   8075 Dec 20 15:34 1387575267.M898011P52138.mail.domain,S=8075,W=8234:2,ST
-rw-------  1 _dovecot  mail   5813 Dec 26 00:10 1388038212.M972176P22064.mail.domain,S=5813,W=5927:2,ST
-rw-------  1 _dovecot  mail   3467 Jan  2 10:28 1388680099.M114308P15988.mail.domain,S=3467,W=3542:2,S
-rw-------  1 _dovecot  mail   3434 Jan  2 10:31 1388680278.M267619P16164.mail.domain,S=3434,W=3509:2,S

Accepted Solution

tamray_tech earned 0 total points
ID: 39765526
resolved issue by using imapcopy

Author Closing Comment

ID: 39776080
Resolved the issue

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now