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

Joseph
  • 153
  • 1
  • 1
  • 12

1 Answers1

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.

damolp
  • 331
  • 1
  • 6
  • 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 '15 at 18:58
  • @Joseph that's one option -- the mailboxes are stored in /Library/Server/Mail/Data/mail//*, with symlinks from .../mail/users/. 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)... – Gordon Davisson Sep 15 '15 at 05: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. – Gordon Davisson Sep 15 '15 at 05: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 '15 at 06:18