tribler.upgrade_script
UPDATE THIS FILE WHENEVER A NEW VERSION GETS RELEASED.
Checklist:
Have you changed
FROMto the previous version?Have you changed
TOto the current version?Have you changed
upgrade()to perform the upgrade?
Attributes
Functions
|
Backport for |
|
Copy a file if it does not exist. |
|
Check if the src path is set and copy it into the dst if it is. |
|
Read the file at the source path and import its settings. |
|
The inner injection script to write old StatementOp info into the current database. |
|
The inner injection script to write old ChannelNode info into the current database. |
|
Import old ChannelNode entries. |
|
The inner injection script to write old TrackerState info into the current database. |
|
Import old TrackerState entries. |
The inner injection script to write old TorrentState info into the current database. |
|
Import old TorrentState_TrackerState entries. |
|
|
Fetch data from the old database and attempt to insert it into a new one. |
|
Perform the upgrade from the previous version to the next version. |
Module Contents
- 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
sourceshould be expected to be in the FROM format. The files indestinationshould be expected to be in the TO format.Make sure to deal with corruption and/or missing files!