Hi Garvin,
An example script for that is in the bundled-libs directory of s9y. It got unmaintained, so if anyone here wants to polish it up, have a go.
I wrote the docs/upgrade.sh script originally and didn't realize it was now out of date, my fault for not keeping in the loop I suppose. I ...