Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-11-2009, 02:23 PM
New Member
 
Posts: 4
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
Reply With Quote
  #2 (permalink)  
Old 11-11-2009, 03:22 PM
Moderator
 
Posts: 1,147
Default

Did you try the recovery steps mentioned in comment #5 of Bug 35100 - Able to add active account to other users alias lists?
Reply With Quote
  #3 (permalink)  
Old 11-11-2009, 04:30 PM
New Member
 
Posts: 4
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:
Quote:
> 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:
Quote:
> 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 05:17 PM.. Reason: Problem posting reply
Reply With Quote
  #4 (permalink)  
Old 11-11-2009, 04:54 PM
Moderator
 
Posts: 1,147
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 04:56 PM.. Reason: More info
Reply With Quote
  #5 (permalink)  
Old 11-12-2009, 05:24 AM
New Member
 
Posts: 4
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à! 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!
Reply With Quote
  #6 (permalink)  
Old 05-14-2010, 07:51 AM
Member
 
Posts: 11
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?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.