recovery from complete loss of mailboxes.db?

Nic Bernstein nic at onlight.com
Sat Apr 29 18:36:37 EDT 2017


Patrick,
I don't have all of your answers here, but I do have some, interspersed 
in your message..

On 04/29/2017 02:41 PM, Patrick Goetz wrote:
> Hi -
>
> I'm assembling some system documentation for a client and have been 
> pouring over my cyrus notes and looking at the man pages.  A couple of 
> questions, starting with the simple one.
>
> annotations.db: "This database contains mailbox and server annotations."
>
> I still have no idea what this is used for.  Can someone give me an 
> example of a mailbox or server annotation.

Annotations are basically metadata which can be associated with 
different objects: Server, Mailbox and Message.  There is a list of 
supported annotations in the old FAQs:
http://cyrusimap.org/imap/reference/faqs/o-annotations.html?highlight=annotations

This is less than ideal, we know, but as noted on the skeletal 
Annotation documentation pages, the documentation is a work in progress.

To see how to apply annotations, see the manpage for cyradm(8).

> Next:  Suppose I've completely lost /var/imap/mailboxes.db as well as 
> /var/imap/db.backup1 and /var/imap/db.backup2.  Is there any way to 
> recover from this?  Given that
>
>     /usr/lib/cyrus/bin/reconstruct -r -f user/userN
>
> will add missing mailfolders to mailboxes.db, can I reconstruct 
> mailboxes.db by simply iterating over all mailbox directories?
>
>   # cd /srv/imap/user
>   # for i in $(ls)
>   # /usr/lib/cyrus/bin/reconstruct -r -f user/$i
>   # done
>
> ?

While this will work, after a fashion, you may also end up restoring 
data which was already deleted in the prior state, depending upon 
Delayed Expunge and Delayed Delete settings.  Also, your use of 'ls' in 
that example may be less than ideal in a server with lots of mailboxes.  
So, 'find' may be more friendly here.

> Finally a note on the documentation:
>
> On this page:
>
>   https://cyrusimap.org/imap/reference/faqs/o-reconstruct.html
>
> one finds the following comment: "If you do find yourself with a 
> corrupted mailboxes.db, there are a few things you can try. The first 
> is to see if db_recover can recover your database."
>
> However, there is no db_recover listed under Tools & Utilities here:
>
>   https://cyrusimap.org/
>
> /usr/bin/db_recover is installed on my system, so it exists, but there 
> isn't a man page for it, either, leading to wonder how one is supposed 
> to know what the syntax is for this command.

The 'db_recover' command is a Berkeley DB command, not a Cyrus command, 
which is why we don't include a man page for it.  If all of your DBs are 
Skiplist, as you state below, then db_recover is not going to be of any use.

For the record, the "o-" prefix on those FAQs is there to indicate 
"Old."  While Cyrus once required Berkeley DB, it now actively 
discourages it.

> I guess that wasn't actually the final question.  I'm currently 
> running version 2.5.10 and am thinking about upgrading to 3.0.1. The 
> default db format appears to be Twoskip, and I'm pretty sure that all 
> my db files are Skiplists.  Is this going to be like the Berkeley DB 
> to Skiplist thing when upgrading from 2.2 to 2.4, where all the 
> Berkeley DB databases were automatically converted to Skiplists, or 
> does a conversion to Twoskip require some manual intervention?

Check the Upgrade docs for this.  There's a note in there about DB 
conversions.
     http://cyrusimap.org/imap/download/upgrade.html

Cheers,
     -nic

>
> Thanks in advance.
> ----
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

-- 
Nic Bernstein                             nic at onlight.com
Onlight Inc.                              www.onlight.com
6525 W Bluemound Rd., Ste 24	          v. 414.272.4477
Milwaukee, Wisconsin  53213-4073	  f. 414.290.0335



More information about the Info-cyrus mailing list