Migrating project:DABL project

Hey all,

I’ve recently specced up a DAML proposal that included project:DABL and it got shot down for several reasons. One of them was that they felt the migration process in future from DABL to another storage medium such as an enterprise blockchain might be difficult or impossible down the track.

I haven’t seen anything talking about how this might be done, can anyone shed some light on the process that would need to occur - if there even is any such process possible?

1 Like

Hi @smallbatch-apps,

It depends a bit on what exactly you intend to migrate. The approach I would usually recommend for any ledger migration is an app-level (i.e., using the ledger API or the HTTP JSON API) active contract set (so no history) migration. You can do that on any ledger which exposes either the gRPC or the JSON API including DABL.

  1. Query for all active contracts signed by a set of parties you control on both ledgers.
  2. Recreate those contracts on a different ledger using multi-party submissions to handle multi-signatory contracts. Note that this is not quite as simple as it might sound. You have to remap contract ids and party ids since those will in general be different on the new ledger.

There are two caveats here:

  1. You can only migrate the parts of the ledger that are visible to you. Of course, multiple parties can run through the same migration process to add contracts only visible to them as well.
  2. You don’t get history. Over the JSON API (and thereby DABL), there is no chance of changing this. If you do have access to the gRPC you could query the transaction tree service and try to migrate that but there are a bunch of issues here (you run into issues around divulged contracts, time assertions in choices, )… so I’d generally recommend against that.
  3. If you want to migrate a contract that is signed by both you and one or more other parties not under your control on the new ledger, you cannot simply run a multi-party submission and you have to go collect authorization, e.g., through a propose-accept workflow.
2 Likes

I would like to add that we are working on tooling for this.

Hi @smallbatch-apps

Our next generation of Canton protocol based DAML Connect participant nodes will support so-called PCS repair operations. These repair operations will not only allow you to recover from unforeseen data corruption, but can also be used to migrate contract data or instances.

Here is a peek at the functions that will support this: Canton Console — Canton 0.21.0-SNAPSHOT documentation

But that’s a preview feature as of now and we’ll be adding appropriate tooling for that.