I have managed to destroy my ldap database. My mail store (/opt/zimbra/store) and mysql databases are intact (restored). I created new ldap accounts matching my old accounts but, of course, the new accounts point to new mail stores.

How can I make my ldap accounts (zimbraPrefIdentityId) match the old account_id's (zimbra.mailbox.account_id) in the mysql database or vice versa?

I can see the accounts in the mysql database (zimbra.mailbox.account_id) but there is a foreign key constraint preventing me from doing an UPDATE on the account_id field. I don't want to remove the foreign key for fear of messing up something else.

I can see the ldap zimbraPrefIdentityId, using zmprov gid. However, I cannot modify it using "zmprov mid". "Zmprov mid" returns an error, probably for some very good reason.

I am running zimbra 7.2.5 community edition on Centos 6.4.

HELP! I have seen multiple similar questions on the forums, but nobody has actually addressed a solution. And please don't tell me that I need to do better backups, it's a little late for that.

Thanks for any help