Avoiding Migration Pitfalls: A Workaround for Upgrading Umbraco Forms to 13.4.0

Upgrading Umbraco can sometimes feel like a smooth ride, but other times, it’s more like navigating through a pothole-filled road. Recently, I faced a rather frustrating issue when upgrading an Umbraco instance from v10.8.7 to v13.5.2. In this case, it wasn’t the Umbraco core that posed the challenge, but Umbraco Forms. This is a common pitfall that I’m sharing to prevent other companies from running into the same issue.

The Problem

As I was updating the system, I was following the usual upgrade path: migrating Umbraco to the latest version and then updating the Umbraco Forms package. However, the process didn’t go as smoothly as expected. The Forms migration was failing midway, specifically when trying to execute a step called “PopulateNodeTableAndNodeIdToForms.” At this stage, I received an error message that read:

"Invalid column name 'createdBy'"

It was clear something was wrong, but I couldn’t immediately pinpoint the cause.

The issue arose during the migration from Umbraco v10.x.x to v13.x.x. Umbraco Forms tries to execute all the migrations between these versions, from 10_0_0 to 13_4_0. However, when it reached migration 12_0_0, the system tried to reference columns (CreatedBy and UpdatedBy) that didn’t exist in the database schema at the time. These columns were only introduced in version 13_4_0.

So, the SQL query generated by the migration process included these columns, but because they weren’t yet in place, the migration failed. It was like trying to build a house on a foundation that wasn’t fully constructed. The query couldn’t find what it was looking for and simply couldn’t proceed.

Why Am I Sharing This?

When I faced this issue, I knew I wasn’t the only one who would run into it, especially as more people began upgrading from earlier versions of Umbraco. So, I decided to share this experience and the workaround I discovered. I hope this post helps prevent other companies from running into the same roadblock, saving you time and frustration during your migration process.

The Workaround:

After some digging and testing, I found a workaround that worked for me — and has since helped other developers in similar situations. Here’s the step-by-step process:

  1. Install Umbraco Forms 13.3.0 First
    Instead of jumping directly from an older version of Umbraco Forms to 13.4.0, install 13.3.0 first. This version ensures the database schema is correctly prepared for the necessary changes in 13.4.0. It’s a small step, but it makes all the difference in preventing column errors.

  2. Upgrade to 13.4.0
    Once you have 13.3.0 installed and the database schema is prepared, you can safely update to 13.4.0. This is where the new columns (CreatedBy, UpdatedBy) are introduced, so the migration should proceed without errors.

  3. Complete the Final Update to the Latest Version
    With 13.4.0 now in place, you can proceed with the final upgrade to the latest version of Umbraco Forms (such as 13.6.0). This will complete your upgrade, and you should no longer encounter the previous error.

Steps to Reproduce

To recap, if you encounter the same issue during your migration process, here are the steps to reproduce:

  1. Start by upgrading Umbraco from version 10.x.x to the latest Umbraco version (e.g., 13.5.2).
  2. Attempt to update Umbraco Forms to the latest version during the upgrade.
  3. At some point, the migration will fail at the “PopulateNodeTableAndNodeIdToForms” step due to missing columns (CreatedBy, UpdatedBy).
  4. Apply the workaround by first installing Forms 13.3.0, then updating to 13.4.0, and finally upgrading to the latest version (13.6.0).

Conclusion

Upgrading Umbraco can sometimes present unexpected challenges, as I discovered while migrating from v10.8.7 to v13.5.2. The issue I encountered with Umbraco Forms involved missing columns during the migration process, which caused the "Invalid column name" error.

To resolve this, I found that installing Umbraco Forms 13.3.0 first, then upgrading to 13.4.0 before the final update to the latest version (13.6.0), prevented the issue.

I’m sharing this to help others avoid the same roadblock. For more details, check the issue I created on the Umbraco Forms issue tracker.