need assistance migrating dovecot mailboxes to new server

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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jan SpringerCommented:
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.
tamray_techAuthor Commented:
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
tamray_techAuthor Commented:
resolved issue by using imapcopy

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tamray_techAuthor Commented:
Resolved the issue
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Servers

From novice to tech pro — start learning today.