Refactored methods related to restoring of local database.
Refactored migration of remote database to a separate method.