0

is there a way to copy a user's IMAP account from an old server installation to a new one? I am wanting to set up my Mac OS X Server fresh and want to avoid having to download all the mails and folders onto a local machine to then copy them back. Is there a way for me to copy only the IMAP accounts/structures from the old server and "migrate" them to the new one?

Thanks

1 Answer 1

1

The mail is stored in:

/Library/Server/Mail/Data/mail/

You should be able to copy this over to the new server, however I suggest using tar or similar to preserve permissions, ownership and links.

4
  • Do I need to preserve/reimport the open directory? So that the network users can be connected with their respective IMAP account...
    – Joseph
    Sep 14, 2015 at 18:58
  • @Joseph that's one option -- the mailboxes are stored in /Library/Server/Mail/Data/mail/<User's GUID>/*, with symlinks from .../mail/users/<accountname>. If the account names and/or GUIDs change, you'll have to rearrange the directory names and/or links accordingly. Keeping the OD database means you don't have to worry about that, but you may bring over other config info you don't want (e.g. if the new server doesn't have the same IP and hostname, it'll inherit bits of the old server's identity)... Sep 15, 2015 at 5:04
  • BTW, if you export and reimport just the users (and maybe groups), either with Server.app or dsexport and dsimport, that'll keep all names and GUIDs (all user attributes except passwords) without bringing over all the other OD config info. Oh, and you don't have to worry about preserving file ownership -- the whole thing is _dovecot:mail. Permissions (mode bits) might be good to preserve, though. Sep 15, 2015 at 5:08
  • I assume I do the same for Calendars and Contacts. However when I try to cd into that directory permission is denied.
    – Joseph
    Sep 15, 2015 at 6:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .