How to migrate from StaticBlock to StructBlock?

I have to change an already existing StaticBlock to a StructBlock:

class SomeBlock(blocks.StaticBlock):

    class Meta:


class SomeBlock(blocks.StructBlock):

    class Meta:

However if the wagtail page has already SomeBlock configured in it, I receive the error:

NoneType is not iterable

Since I don't have anything inside the StaticBlock. I need to write a custom data migration for this.

Based on Schema Operations listed, I couldn't find a way to change the actual block type. How do I approach this?

StructBlocks and StaticBlocks live inside StreamFields so you need a Wagtail-specific method for converting blocks within a StreamField. Please see for a discussion of the issue. Then you can use the project described Or, if you want to try out Wagtail 4.2rc1, you can try the built in migration helpers:

Back to Top