Added backup and restore functions.