Migrating from Fiber version 2 to version 3

March 22, 2026 by J. Wubben

Stabby with go-fiber

All of my Go projects that use REST are using go-fiber. At least 5 of my projects use this module, including the webapp that serves this very website. When I noticed that version 3 had been released, I was worried that it would be migration hell (we've all done upgrades that have gone South, right?).

While 'hell' ended up being a bit of an overstatment, I did run into a couple of errors. In this post, I'm going to discuss the issues I encountered with this migration and how to resolve them.

Note: This post is not a dig or a jab at the go-fiber maintainers. The maintainers are a great team and I've used go-fiber for more than 3 years now. This is merely an informational post for those who still have yet to do the migration and are wondering if there are unknowns or risks they may run into during the process.

Fiber migration tool

Fiber can migrate your projects from version 2 to version 3 with minimal issues using fiber migrate --to v3.

A word of caution: Be sure to examine all changes made after running this tool. In my case, fiber ended up changing BootIndex to BootIndexNames, as seen in the image below. This change was made in quite a few places, and I had to go through and revert it manually.

fiber v3 migration changing things it shouldnt be

Trust Proxy Configuration

Another new change with the move from Fiber version 2 to version 3 is the Trust Proxy Configuration. I was not using this feature, so when I migrated to go-fiber v3, my WAF was not properly translating the X-Forwarded-For header. This resulted in WAF triggers banning my proxy, which, in turn, resulted in all traffic access being denied. You might think that this isn't a big deal, but because this webapp uses a WAF, the proxy getting blocked results in all users effectively getting banned. So, this is definitely something to keep in mind and watch out for.

I opened a bug report regarding the issue. Basically, your go-fiber app config should have a TrustProxyConfig, like so:


app := fiber.New(fiber.Config{
  TrustProxy:   true,
  TrustProxyConfig: fiber.TrustProxyConfig{
    Private: true,
  },
}
  

Shout-out to highlight.js for having a dead simple syntax highlighter library.

Summary

Overall, the 'migration hell' ended up being nothing too crazy.

  1. The fiber migration tool ended up changing code that had nothing to do with fiber, which had to be corrected.
  2. Fiber v3 now requires trusting proxies. The migration tool does not account for this, which ended up breaking my WAF middleware.

Key takeaways from my experience: When using the fiber migration tool, make sure you check all the code that was changed. If are using a proxy for your application and were not using Trusted Proxies before, do not forget to add the configuration.

If you have questions about this blog post, or would like to suggest a topic for a future blog post, please feel free to reach out.