Backing up and resoring to local database