Fix bug: DB is locked when it runs data import in a migration task.