Upgrade from 0.40.3 to latest

I’m researching ways to upgrade my Hugo version. I have a live site generated at Netlify from my github repo. I’m not sure about the best way of going about this as I know the jump between versions is significant. Also I have a custom theme based off of Academic and I will need to upgrade that too.

I was thinking about doing all the upgrades in another git branch, but then I realized ill need to be running two different versions of Hugo on my PC to make that work. I guess I could just upgrade hugo on another computer with the latest version of hugo and not push changes until im ready but that feels risky.

Could anyone more skilled at this chime in as to which way is best in doing this. I want to upgrade because I dont want to wait to long to upgrade to a newer version and I like some of the new features.

If you install Go locally it would help you make incremental upgrades to your Hugo installation with

go get -u -v github.com/gohugoio/hugo@v0.42

and then once you finish your work you can change back to the Hugo version you use to deploy your project by changing the version number in the same command.

Also note that Hugo 0.54.0 introduced SemVer numbering for Hugo releases.

You will need to include the extra zero for Hugo minor versions later than 0.54.0 because otherwise the above command will throw an error. (minor patch releases have always been in the form of 0.54.1)

In my opinion, the best way to do the upgrade would be to work on a separate git branch -as you said-, read the release notes for versions later than 0.43 and fix the breakage one step at the time so that it does not become overwhelming.

There have been indeed plenty of changes, so it will take time.

Good luck.

That totally depends on what features you use. I have seen lots of very old (simple) Hugo sites working fine after some minor adjustments.

Sure but in this case the OP is using a forked version of the Academic theme (that is not a simple theme, they have also rebranded to Wowchemy in the last year or so).

Thank you for the response. I plan on working on this between Christmas and new years.

Will installing go locally interfere with my current install of Hugo?


But after you install go you will need to add its /bin/ folder to your system’s PATH (if it is not added automatically) so that you can install Hugo versions more easily with the above command.

Once you do the above you should remove your previous Hugo installation.