Results 1 to 6 of 6

Thread: [SOLVED] Recover 'lost' account from db & store?

  1. #1
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    5

    Question [SOLVED] Recover 'lost' account from db & store?

    Hi everyone,

    I've been running Zimbra for about 2 years now and barely had any problems I couldn't solve thanks to the extensive wiki and the forum's search engine.

    However today I encountered this problem, while trying to change the domain and adding an alias (without saving inbetween the 2 steps).
    Consequently the edited account has disappeared from the admin interface..
    It's a known bug for 5.0.12 and has been fixed, but before fixing the installation with an upgrade, I desperately need to recover the mails (including folder structure) if somehow possible.

    The DBs (/opt/zimbra/db/data/mboxgroup11) and mails (/opt/zimbra/store/0/11/) still exist.
    I'm also able to restore the bare mails using zmlmtpinject (see here for more info), but I haven't figured out a way to recover the account itself (or at least the folder structure).

    I'd be happy about any idea or advice/help how to regain the mailbox!

    Thanks,
    Chris

  2. #2
    Join Date
    Feb 2007
    Location
    Portland, OR
    Posts
    1,147
    Rep Power
    10

    Default

    Did you try the recovery steps mentioned in comment #5 of Bug 35100 - Able to add active account to other users alias lists?

  3. #3
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    5

    Default

    Thanks for your reply! I like the idea of the trick to create a new Account based on the old zimbraID, as the mysql db still provides the account entry!

    Unfortunately I get following return when running zmprov to create the new account:
    > zmprov ca x.y@z.tld password zimbraID 6aae8f57-f067-4d24-b949-20835271de8d
    ERROR: service.INVALID_REQUEST (invalid request: zimbraId is immutable)
    Is it possible that I have to set a flag somewhere to make it 'mutable' or is there any other way to circumvent this?

    Edit: -v provides a lot more information, as far as i can tell unrelated to missing attributes though:
    > zmprov ca testaccount@domain.tld password zimbraID 6aae8f57-f067-4d24-b949-20835271de8d
    ERROR: service.INVALID_REQUEST (invalid request: zimbraId is immutable)
    com.zimbra.common.soap.SoapFaultException: invalid request: zimbraId is immutable
    ExceptionId:btpool0-13:1257984111589:34e6f1b24ca89e7b
    Code:service.INVALID_REQUEST
    at com.zimbra.common.soap.Soap12Protocol.soapFault(So ap12Protocol.java:88)
    at com.zimbra.common.soap.SoapTransport.extractBodyEl ement(SoapTransport.java:263)
    at com.zimbra.common.soap.SoapTransport.parseSoapResp onse(SoapTransport.java:224)
    at com.zimbra.common.soap.SoapHttpTransport.invoke(So apHttpTransport.java:261)
    at com.zimbra.common.soap.SoapHttpTransport.invoke(So apHttpTransport.java:216)
    at com.zimbra.common.soap.SoapTransport.invoke(SoapTr ansport.java:315)
    at com.zimbra.common.soap.SoapTransport.invoke(SoapTr ansport.java:279)
    at com.zimbra.cs.account.soap.SoapProvisioning.invoke (SoapProvisioning.java:191)
    at com.zimbra.cs.account.soap.SoapProvisioning.create Account(SoapProvisioning.java:325)
    at com.zimbra.cs.account.ProvUtil.execute(ProvUtil.ja va:460)
    at com.zimbra.cs.account.ProvUtil.main(ProvUtil.java: 2141)
    is this of any help?
    Last edited by cmenke; 11-11-2009 at 04:17 PM. Reason: Problem posting reply

  4. #4
    Join Date
    Feb 2007
    Location
    Portland, OR
    Posts
    1,147
    Rep Power
    10

    Default

    Oddly enough I was getting the same error, but I can't reproduce it now. Try running
    Code:
    zmprov -v ca testaccount@domain.tld password zimbraId 6aae8f57-f067-4d24-b949-20835271de8d
    to see if it gives you any further info.

    Edit: Some more info:
    I was getting that error, did a -v to see what it was and it started telling me errors about missing extra attributes from the samba/posix extensions i have in my setup. after adding those it worked, removed them and now it is just giving me errors about them, no longer the immutable error.
    Last edited by ArcaneMagus; 11-11-2009 at 03:56 PM. Reason: More info

  5. #5
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    5

    Smile

    Good news: I found a way to change the zimbraID without using the zmprov utility (which would continue to give me the immutable field error).
    The Ajcody-LDAP-Topics helped a lot!

    If anyone else ever runs into the problem, here's how I did it:

    1. Create a new target@domain.com Account (serving as host for old data)

    2. Log current LDAP output for target@domain.com to /tmp/account_old.txt
    Code:
    ldapsearch -H "ldap://<mail.domain.tld>:389" -D "uid=zimbra,cn=admins,cn=zimbra" -b "ou=people,dc=domain,dc=com" -x -a never -w <paswword> "mail=target@domain.com" > /tmp/account_old.txt
    3. Modify zimbraID using ldapmodify:
    Code:
    ldapmodify -x -H "ldap://<mail.domain.tld>:389" -D "uid=zimbra,cn=admins,cn=zimbra" -w <password>
    dn: uid=target,ou=people,dc=domain,dc=com
    changetype: modify
    replace: zimbraID
    zimbraID: 6aae8f57-f067-4d24-b949-20835271de8d
    Hit Ctrl+D
    4. Log new LDAP output for target@domain.com to /tmp/account_new.txt
    Code:
    ldapsearch -H "ldap://<mail.domain.tld>:389" -D "uid=zimbra,cn=admins,cn=zimbra" -b "ou=people,dc=domain,dc=com" -x -a never -w <paswword> "mail=target@domain.com" > /tmp/account_new.txt
    Voil&#224;! Step 2 and 4 are not mandatory, but helped to confirm that the change was succesful.

    I presume that the mysql data for the initially created target@domain.com Account could be be cleaned from the DB, but I haven't had time to look into that yet. Just happy mails and everything else were recovered

    Thanks for the help Arcane!

  6. #6
    Join Date
    Jul 2008
    Posts
    11
    Rep Power
    7

    Default

    I used this tip to recover some missing accounts after ZCS 5 to 6 migration.

    I noticed that if you delete the target@domain account, the mail store of both accounts are deleted as they share the same mailboxId

    I could not figure out to change the mailboxId for an account
    Is that possible?

Similar Threads

  1. recover server with db, Index, Store
    By manipulator in forum Installation
    Replies: 1
    Last Post: 08-25-2009, 01:15 PM
  2. Recover deleted account
    By bhwong in forum Administrators
    Replies: 1
    Last Post: 04-08-2009, 07:07 AM
  3. Replies: 0
    Last Post: 11-14-2008, 09:01 PM
  4. [SOLVED] Recover lost history
    By soulskater in forum Administrators
    Replies: 3
    Last Post: 03-11-2008, 11:58 PM
  5. Replies: 2
    Last Post: 02-12-2008, 10:55 AM

Posting Permissions

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