/!\ WARNING: at least one person using these instructions has ended up with a database with the wrong contents, and accidentally ended up sending a few thousand spurious certs to the rest of his group. So be careful! The algorithm given here seems correct in principle, but it could be explained clearer; make sure you are very careful if you use it, or ask in #monotone @ irc.oftc.net for hints, until we find time to expand this page.

Rosterifying Private Branches

Rosterifying private branches can be problematic, as revisions found in the private database will conflict with revisions in the main database. The procedure below can be used to work around these problems with out any data loss.

Make sure you make a backup of your database before attempting any of these steps.

The first step is to rosterify your private database. $ mtn db migrate --db private.mtn $ mtn db rosterify --db private.mtn

Make sure the rosterify went ok and double-check the revisions in your private database and the main database making sure they have the same revision IDs (you only have to check the latest version). Next get a list of all the revisions in the main database and delete those from your private database. $ for RID in mtn automate select i: --db main.mtn; do mtn --db private.mtn db execute "DELETE FROM revision_certs WHERE id = '$RID'"; done

Now your private database contains a rosterified version of your private branches with no conflicting rosterified certs. The next step is to fix the epochs for your private branches. To do this, get the epochs from the main database and set them in the private database. $ mtn --db main.mtn ls epochs $ mtn --db private.mtn db set_epoch net.venge.monotone <main.mtn epoch> (repeat for each overlapping branch)

The last step is to pull the rosterfied certs from the main database into your private database.