added backup database code (if enabled) to support backing up the database in case of cons
istency issues.