Implement code to *restore* a database backup. Again.

Ironically, I lost the original version of this commit due to lack of backups.