The solution that has been easiest for us is to install WeBWorK on a VM. We're using the Proxmox hypervisor and there's a nightly backup process.
If something goes wrong, we just restore the VM image from backup and everything is back up and running in a couple of minutes.
(Full disclosure: I've got a colleague on the computer science side of the department who assists with this.)