tribler.upgrade_script

UPDATE THIS FILE WHENEVER A NEW VERSION GETS RELEASED.

Checklist:

  • Have you changed FROM to the previous version?

  • Have you changed TO to the current version?

  • Have you changed upgrade() to perform the upgrade?

Attributes

FROM

TO

logger

Functions

batched(→ collections.abc.Generator[list])

Backport for itertools.batched().

_copy_if_not_exist(→ None)

Copy a file if it does not exist.

_copy_if_exists(→ None)

Check if the src path is set and copy it into the dst if it is.

_import_7_14_settings(→ None)

Read the file at the source path and import its settings.

_inject_StatementOp_inner(→ None)

The inner injection script to write old StatementOp info into the current database.

_inject_ChannelNode_inner(→ None)

The inner injection script to write old ChannelNode info into the current database.

_inject_ChannelNode(→ None)

Import old ChannelNode entries.

_inject_TrackerState_inner(→ None)

The inner injection script to write old TrackerState info into the current database.

_inject_TrackerState(→ None)

Import old TrackerState entries.

_inject_TorrentState_TrackerState_inner(→ None)

The inner injection script to write old TorrentState info into the current database.

_inject_TorrentState_TrackerState(→ None)

Import old TorrentState_TrackerState entries.

_inject_7_14_tables(→ None)

Fetch data from the old database and attempt to insert it into a new one.

upgrade(→ None)

Perform the upgrade from the previous version to the next version.

Module Contents

tribler.upgrade_script.FROM: str = '7.14'
tribler.upgrade_script.TO: str = '8.0'
tribler.upgrade_script.logger
tribler.upgrade_script.batched(results: list, n: int = 1) collections.abc.Generator[list]

Backport for itertools.batched().

tribler.upgrade_script._copy_if_not_exist(src: str, dst: str) None

Copy a file if it does not exist.

tribler.upgrade_script._copy_if_exists(src: configparser.ConfigParser, src_path: str, dst: tribler.tribler_config.TriblerConfigManager, dst_path: str, conversion: type) None

Check if the src path is set and copy it into the dst if it is.

tribler.upgrade_script._import_7_14_settings(src: str, dst: tribler.tribler_config.TriblerConfigManager) None

Read the file at the source path and import its settings.

tribler.upgrade_script._inject_StatementOp_inner(db: pony.orm.Database, batch: list) None

The inner injection script to write old StatementOp info into the current database.

tribler.upgrade_script._inject_ChannelNode_inner(db: pony.orm.Database, batch: list) None

The inner injection script to write old ChannelNode info into the current database.

tribler.upgrade_script._inject_ChannelNode(abs_src_db: str, abs_dst_db: str) None

Import old ChannelNode entries.

tribler.upgrade_script._inject_TrackerState_inner(db: pony.orm.Database, batch: list) None

The inner injection script to write old TrackerState info into the current database.

tribler.upgrade_script._inject_TrackerState(abs_src_db: str, abs_dst_db: str) None

Import old TrackerState entries.

tribler.upgrade_script._inject_TorrentState_TrackerState_inner(db: pony.orm.Database, batch: list) None

The inner injection script to write old TorrentState info into the current database.

tribler.upgrade_script._inject_TorrentState_TrackerState(abs_src_db: str, abs_dst_db: str) None

Import old TorrentState_TrackerState entries.

tribler.upgrade_script._inject_7_14_tables(src_db: str, dst_db: str) None

Fetch data from the old database and attempt to insert it into a new one.

tribler.upgrade_script.upgrade(config: tribler.tribler_config.TriblerConfigManager, source: str, destination: str) None

Perform the upgrade from the previous version to the next version. When complete, write a “.upgraded” file to the destination path.

The files in source should be expected to be in the FROM format. The files in destination should be expected to be in the TO format.

Make sure to deal with corruption and/or missing files!