Results 1 to 10 of 10

Thread: [SOLVED] Restore user account from LDAP

  1. #1
    Join Date
    Jun 2008
    Location
    London
    Posts
    7
    Rep Power
    7

    Default [SOLVED] Restore user account from LDAP

    Hi all,
    is there a way to restore only a certain user's acount from the LDAP backup?
    (it was deleted by accident).

    Thanks in advance.

  2. #2
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    Code:
    su - zimbra
    zmcontrol -v
    http://www.zimbra.com/forums/announc...r-profile.html please so we know which version of ZCS you are running

  3. #3
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    Both zmrestore & zmrestoreldap support the -a switch. However, if you meant that you deleted the entire account you probably want more than just the LDAP data back. Use the -ra argument on zmrestore which restores both LDAP & mailbox data.

    CLI zmrestore Network Edition only - Zimbra :: Wiki
    zmrestore -ra -a user@domain.com
    /docs/ne/latest/administration_guide/10_Backup_Restore.15.1.html#1039536
    CLI zmrestoreLDAP Network Edition only - Zimbra :: Wiki
    CLI zmrestore restoreToTime Network Edition only - Zimbra :: Wiki

    Or use the admin console GUI.

    EDIT:
    It is good if you tell us the version though, so we can search for any known bugs & their workarounds in your release. (Which are always quickly fixed in following releases I might add, as we're talking about backup/restore that people depend upon - note that I'm NOT saying 'immediately upgrade now if you're not on 5.0.7' as backups only work for your current server version Bug 14002 - Add conversion tool to upgrade backup versions to allow restore on later zcs versions & Bug 15750 - support for restore across major versions which is why we recommend that the first thing you do upon upgrading is to take a full backup - so you have something to easily restore to (without throwing up an older ZCS instance) if they should accidentally delete all their mail the next day
    Last edited by mmorse; 07-07-2008 at 07:23 AM.

  4. #4
    Join Date
    Jun 2008
    Location
    London
    Posts
    7
    Rep Power
    7

    Default

    Hi uxbod,

    I've updated my profile.

    Release 5.0.7_GA_2450.RHEL5_64_20080630195205 RHEL5_64 NETWORK edition

  5. #5
    Join Date
    Jun 2008
    Location
    London
    Posts
    7
    Rep Power
    7

    Default

    The problem is that i'm using Samba and PosixAccount extensions, so zmrestore does not work for me.

    Code:
    [zimbra@happy]$ zmrestore -ra -a username@illumina.co.uk -restoreToTime 20080704223000
    using restore to time of 2008/07/04 22:30:00
    Error occurred: invalid request: createAccount invalid schema change: [LDAP: error code 65 - object class 'posixAccount' requires attribute 'uidNumber']
    I thought if I could first restore the account from the LDAP backup (LDIF file) I could restore the mailbox from the web gui.

  6. #6
    Join Date
    May 2006
    Location
    USA
    Posts
    6,242
    Rep Power
    21

    Default

    Sounds kinda close to Bug 20363 - BNR fails to restore accounts that were created and backed up prior to Zimbra-Samba integration

    If you got some downtime how about:
    su - zimbra
    zmprov mcf -zimbraAccountExtraObjectClass posixAccount
    zmprov mcf -zimbraAccountExtraObjectClass sambaAccount
    zmprov mcf -zimbraAccountExtraObjectClass sambaSamAccount
    zmcontrol stop
    zmcontrol start
    Restore (btw if you use restoreToTime please use the -lb argument to specify a full to work from - see: Bug 15320 - zmrestore using restoreToTime option restores data after the specified time & Bug 28320 - zmrestore -restoreToTime should fail if no backup label is passed.)
    zmprov mcf +zimbraAccountExtraObjectClass posixAccount
    zmprov mcf +zimbraAccountExtraObjectClass sambaAccount
    zmprov mcf +zimbraAccountExtraObjectClass sambaSamAccount
    zmcontrol stop
    zmcontrol start

    You may also need to temporarily un-comment some changes to /opt/zimbra/conf/slapd.conf.in if I'm reading that first workaround correctly.

    UNIX and Windows Accounts in Zimbra LDAP and Zimbra Admin UI - Zimbra :: Wiki
    Last edited by mmorse; 07-07-2008 at 08:53 AM. Reason: removing -–

  7. #7
    Join Date
    Jun 2008
    Location
    London
    Posts
    7
    Rep Power
    7

    Default

    Thanks Mike, will give it a try tonight.

    S

  8. #8
    Join Date
    Jun 2008
    Location
    London
    Posts
    7
    Rep Power
    7

    Default

    Quote Originally Posted by mmorse View Post
    Sounds kinda close to Bug 20363 - BNR fails to restore accounts that were created and backed up prior to Zimbra-Samba integration

    If you got some downtime how about:
    su - zimbra
    zmprov mcf -zimbraAccountExtraObjectClass posixAccount
    zmprov mcf -zimbraAccountExtraObjectClass sambaAccount
    zmprov mcf -zimbraAccountExtraObjectClass sambaSamAccount
    zmcontrol stop
    zmcontrol start
    Restore (btw if you use restoreToTime please use the -lb argument to specify a full to work from - see: Bug 15320 - zmrestore using restoreToTime option restores data after the specified time & Bug 28320 - zmrestore -restoreToTime should fail if no backup label is passed.)
    zmprov mcf +zimbraAccountExtraObjectClass posixAccount
    zmprov mcf +zimbraAccountExtraObjectClass sambaAccount
    zmprov mcf +zimbraAccountExtraObjectClass sambaSamAccount
    zmcontrol stop
    zmcontrol start

    You may also need to temporarily un-comment some changes to /opt/zimbra/conf/slapd.conf.in if I'm reading that first workaround correctly.

    UNIX and Windows Accounts in Zimbra LDAP and Zimbra Admin UI - Zimbra :: Wiki
    Thanks Mike, solved!
    There is no need to touch /opt/zimbra/conf/slapd.conf.in.
    Just disable Posix and Samba restore user account and enable Samba again.

  9. #9
    Join Date
    Sep 2008
    Posts
    14
    Rep Power
    7

    Thumbs up

    Thanks!! this saved my day!

    perfect, now i can also use the restore interface in the admin webclient.

  10. #10
    Join Date
    Feb 2007
    Posts
    11
    Rep Power
    8

    Default

    I just had this problem, and this thread saved my day, too!

    I thought I would add a footnote:
    I just followed the commands mmorse wrote, and accidentaly enabled sambaAccount and sambaSamAccount at the same time.

    I don't think these should both be on at the same time.

    see:
    http://www.zimbra.com/forums/adminis...x-samba-2.html

Similar Threads

  1. Replies: 21
    Last Post: 02-04-2010, 10:06 AM
  2. [SOLVED] Zimbra logwatch.
    By nishith in forum Administrators
    Replies: 5
    Last Post: 06-10-2009, 05:42 PM
  3. Post instsallation problems
    By Assaf in forum Installation
    Replies: 14
    Last Post: 01-29-2007, 11:38 AM
  4. Getting problems in FC4 while instalation
    By kitty_bhoo in forum Installation
    Replies: 13
    Last Post: 09-12-2006, 11:34 PM
  5. Fedora Core 3, Clean Install - Not working!
    By pcjackson in forum Installation
    Replies: 17
    Last Post: 03-05-2006, 07:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •