'Run the upgrader if it is enabled in the config.
Note that by default, upgrading is enabled in the config. It is then disabled
after upgrading to Tribler 7.'

def run(self):

    self.current_status = u'Checking    Tribler    version...'
    if self.session.config.get_upgrader_enabled():
        (failed, has_to_upgrade) = self.check_should_upgrade_database()
        if (has_to_upgrade and (not failed)):
            self.notify_starting()
            self.upgrade_database_to_current_version()
            pickle_converter = PickleConverter(self.session)
            pickle_converter.convert()
        if self.failed:
            self.notify_starting()
            self.stash_database()
        self.upgrade_to_tribler7()
