Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Procedure needed to recover user data for mail, ical, files etc.

Dear community


Due to bad luck combined with stupidity and laziness I lost my open directory master, and therefore also all network users (and yes, the back up of OD I did, but that file is corrupted), so that I end up recreating users in the OD. That by itself is not that bad, but the potential loss of data is. To be more precise, currently I am not able to recover the Mailboxes, and specifically for about 10 iPad/iPhone only users, I have no chance to recover them from a time machine backup. So here goes my questions:


1.) Is there a way to copy / import from the old user id to the new one for Mail (Dovecot) ?

Simply copying the files from the old subdirectory to the new one does not work (seems to be secondary permissions), and I did not have any success by using doveadm tools.


2.) Same goes for iCal and Contacts server?

Any suggestions? Haven't tried those yet.


3.) For Home Directories including Mobile users homes I think copying the data and doing a chmod should be sufficient

Clearly the clients would have to delete their mobile homes first and then sync back, but in any case here I could use the TM backups in worst case.




So, can anyone point me in the right direction especially for the mail folders?


Thanks in advance


jheipmann

Mac OS X (10.7.2), Lion Server

Posted on Jan 21, 2012 4:19 PM

Reply
9 replies

Jan 23, 2012 1:27 PM in response to jheipmann

So, in the meantime I figured out some of the topics.


For 1.), the procedure is fairly simple, as long as the old mail directories are still there:

- Log on to IMAP Server with your new user ID

- Stop the mail service

- In Server-Admin, Maintenance Tab, you will find the full user name twice, once with and second without any data in it. You will also find the old and new storage locations of the mails, so simply copy all the contents from the old directory to the new one, then do a

chown -R _dovecot

on it's content.

- Start the mail service


As thought, for migrating the user homes 3.) simply do a

chown -R username /Users/username

that's it.


Leaves me with 2), iCal and Contacts.

Both use the caldav service, and both store their data in the database with the same name in postgres. There is a procedure to backup those dbs here:

Lion OS Collaboration Services - Manually Backing Up and Restoring

Be careful, restoring to the db should actually restore to "caldav" not to "collab", so the correct command is


# psql -U _postgres -d caldav -f /Library/Server/PostgreSQL/Backup/caldav.sql


So, basically you can replace the old GUID of a user with the new one in the backed up file, and restore it. That worked for me, but in the meantime I rebooted and now caldav and contacts are not workiung anymore, I can not even log into any of the accounts. I guess that has to do with loosing contact to the OD master after the reboot, so I guess I will have to dig into more logs.


Message was edited by: jheipmann

Mar 4, 2012 8:07 PM in response to jheipmann

Hi,

I noticed this typo


# psql -U _postgres -d caldav -f /Library/Server/PostgreSQL/Backup/caldav.sql


as well !


Well spotted !


Regards,

Twistan


P.S.

One of my users can longer log in to his iCal account. I do not know how this happened but I remember that I deleted a jointly used iCal account (I mean an account that was used by all) and that that user, who can no longer log-in to his iCal account, had delegation status for that deleted account.

I do not know of this is imprtant. I am by no means a postgrep or server expert. Just an experienced and seasoned physicist and mathematician.


I think I shall delete the old server account and create a new one for that user. I don't know if that deletes any contributions to Wiki pages by that user.


Apple have made trouble-shooting very difficult for Lion server that "everyone" can set-up but not administer properly.

Mar 4, 2012 11:47 PM in response to jheipmann

Hi all


Obviously I left this topic open although I solved it myself. Sorry. Basically above mentioned procedures do work although a little time consuming. The lost access to the collab services was once again due to certificate trouble.


@twistan: thanks for confirming the typo, for the inaccessible user due to delegation I cannot provide any help.


Best regards


Joern

Mar 5, 2012 2:35 PM in response to jheipmann

I'm in a similar situation. I need to restore my wiki after a clean installation. Let me see if I have understood:

  1. First I need to restore the dumpall.psql.gz archive with Time Machine
  2. Second in Terminal: # psql -U _postgres -d collab -f /Library/Server/PostgreSQL/Backup/collab.sql


Is it necesary do something with the folders "Collaboration" and "Wiki"?


Thanks in advance for your help.

Mar 5, 2012 9:11 PM in response to jheipmann

Hi Joern,

thanks for that. I took the gamble and I simply deleted and re-defined the user's account (same short name and password). User had iCal working again imediately.

The user's Wiki read and write ACL's did not work but I found a group (very strange) with the user's name which I deleted as well and now all is fine again.

By the way, the user's wiki entries were not deleted as I had feared.


Regards/Gruss,

Twistan

Mar 5, 2012 9:21 PM in response to delmod

Hi,

please refer to

http://hints.macworld.com/article.php?story=20120204035901957


In my (lay) view you have to dump (back up) all individual databases first:


$ sudo -s

PGUSER=_postgres /usr/bin/pg_dump -U _postgres collab -Fc -f /Library/Server/PostgreSQL/Backup/collab.sql > /dev/null 2>&1


Only if you done that can you restore using the second command

# psql -U _postgres -d collab -f /Library/Server/PostgreSQL/Backup/collab.sql

But I could be mistaken.


Regards,

Twistan

Procedure needed to recover user data for mail, ical, files etc.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.