Developer Docs - Developer Codex - Process to Chop or Swap

When it comes time to replace an existing, production webforms block with a new Obsidian block, there are a few things to consider. Depending on the answers to these questions you are either dealing with a simple case or a complex case.

Simple Case: Follow a Process

If Chop (first time only)

If Swap

Complex Case: Using the Job

The RockMigrationHelper.ReplaceWebformsWithObsidianBlockMigration(…) helper will create a job that performs either a chop or swap of a block type. This helper method will create a Rock.Jobs.PostUpdateDataMigrationsReplaceWebFormsBlocksWithObsidianBlocks job that performs the chop/swap. It is used like this:

RockMigrationHelper.ReplaceWebformsWithObsidianBlockMigration(
    "Chop  ",
    blockTypeReplacements: new Dictionary {
        { "ABC123-1111-1111-1111-111111111111", "DEF456-2222-2222-2222-222222222222" }
    },
    migrationStrategy: "Chop", // or "Swap"
    jobGuid: ""  );

Where the first Guid (ABC123-…) is the block type of the original block being replaced and the second Guid (DEF456-…) is the new block type to replace the original with.

When you are ready to chop/swap your Obsidian block follow these steps: