GuestNo new alerts

Fun with Upgraders

- Announcements1079
One of the big milestones for rolling Gosora out into production, well production on sites other than here, is an upgrader. A nice little script which pulls updates from a remote server, patches files, and then restarts the instance, so that you can continue with your business.

I can't stress how important it is, and thus, it's one of my top priorities for making Gosora a practical forum software. Gosora is actually very easy to update, you basically use the kill command to stop the process, stash config.go, /attachs/ and /uploads/ somewhere safe, and then, you download a fresh copy and overwrite it with those.

You might also need to update the database schema, I will usually note which bits of schema have changed under the "Schema:" section on a commit, I usually bundle lots of features into big commits, so you shouldn't need to flip through too many to find database changes, although they are quite rare.

This might be slightly painful, if you've messed with a file, but it works, however with things like internationalisation becoming more of a thing, this solution is fairly... lacklustre. As such, I've begun work on planning out an upgrader, in fact I've had thoughts about it for quite a while.

Like many features, an upgrader poses a lot of questions for me, like... How do I stop the instance using new files in the process of an upgrade? If a template suddenly changes to one which uses properties which don't exist, it could lead to errors and other issues.

For that case, the conclusion would likely be some sort of lock file to prevent the instance from reloading the files during that duration and just to work with what Gosora has in memory, which just so happens to be every template.

Upgraders are very interesting problem, and I'll see if I can crack it, so that we can get a smoother upgrade process. Wish me luck.