Posted on 11-29-2017 12:47 PM
We have a Mac OS X Server v5.3.1 that has been failing, but we have many good backups. As a matter of fact, the internal HDD had failed and we are currently running off of an image on a bootable external drive. We've built a new instance of server, successfully imported users and groups. The new machine has the same IP address and hostname in order for this to work. DNS and Certificates are setup properly.
There is concern that some the original server data is corrupt. For that reason, we don't want to move all of the server data, only the mail database.
Apple provided this guidance, but we're not having much success:
1) To backup the mail folder: tar -czvf mailbackup.tar.gz /Library/Server/Mail/Data You still see the file “mailbackup.tar.gz” appear inside the home folder >of who you are currently logged in as. 2) Move the file over to the new machine. You can put on a portable >external, usb thumbdrive, or store it on a sharepoint elsewhere on the >network. No special commands here 3) To restore the folder: tar -xvpf mailbackup.tar.gz It knows the path already so there’s no need to specify a path. The first issue is that Apple's guidance extracts the archive to the user library, not the system library at ~/Library/Server/Mail/
We did modify the extraction command so that the data was properly extracted to: /Library/Server/Mail with the resulting files at: /Library/Server/Mail/Data
The problem is that although the data compares in location, file size, dates and permissions, all mailbox data is lost for the Local Network User. Mail client can receive and send new mail however. (All old mailbox data is ignored or missing)
We can switch between servers by simply swapping the ethernet cable between servers.
Apple is saying "Moving mail data between servers is not directly supported by Apple Enterprise support" so they are of no further help.
What are we overlooking ?
Peter
Posted on 11-29-2017 01:43 PM
Some mailboxes are created after the users UUIDs. So I'd check if users have the same UUID as in the previous server. Look for users UUIDs in Server.app > Users and then compare those UUIDs with the folders inside /Library/Server/Mail/Data/mail
Posted on 11-30-2017 03:45 AM
Here's what I discovered.
Apple's guidance to use tar -czvf mailbackup.tar.gz /Library/Server/Mail/Data while logged in as the local admin copied the Folders for each user, but did not copy the contents of the folders or preserve the permissions (empty folders).
I had to switch to the root user:
sudo
su
password:
tar -czvf mailbackup.tar.gz /Library/Server/Mail/Data
My mail archive is now 8.8GB compared to 226MB previously. I'm in the process extracting this archive to the new server.