Purge Tool

From OOTP Wiki
This is the approved revision of this page, as well as being the most recent.

OOTP contains a "purge tool", which purges deleted players, teams, coaches and so on from the .dat files. Since game data is loaded into memory sequentially, starting with ID#1, having a large number of deleted data can lead to a significant slowdown as the game has to load all those now-empty records, a particular problem for online leagues. The purge tool reassigns all the ID numbers in a new sequential order, making loading much more efficient.

The tool purges deleted players, leagues, teams, and coaches and reassigns the ID numbers in the reamining records, then assigns the changed IDs to player and coach pictures, nessage files, text files for leagues, teams, and players, box score files, and game log files, and then deletes report files. The report files will be rebuilt when they're opened again.

The button is on the database info page in the Tools menu: "Purge deleted records from database." To use it:

  1. Always make a backup copy of the league folder before using this tool.
  2. Run the purge tool.
  3. Make a second backup copy after running the tool.
  4. Remove all report html files and all other files which you do not want to send to the GMs like /settings/accountsdata_commish.dat – you can get them back from the second backup copy later.
  5. Zip the whole league folder and put it on the server.
  6. Make a copy of the league folder again, load it and test it. If everything is working properly, you can delete that league folder.
  7. Ask your GMs to stop OOTP, rename the saved game folder of your league and download and unzip your archive to get the new saved game folder for your league.

Purge Tool FAQ:

1. After running a purge on the master copy of the league do I have to do anything special to update the GMs other than to upload a new league file?

No, just upload a new league file.

2. I know the purge process may change some/all player IDs and it scans/updates .txt files to handle these changes. When I create the league file after the purge are those modified league files included in the league file?

That depends on the league file settings. The best and safest solution would be to archive the whole /news/txt folder from the saved game after the purge and send it to the GMs.

3. Player pictures' file names have the player ID in them but I don't think those are renamed when you purge. Does running the purge process mean the the players pictures need to be regenerated and players will have different pictures after the purge?

Player picture files are renamed during the purge, so that’s another folder to send to the GMs manually after the purge.

4. Will old boxscores and gamelogs have the wrong player IDs in them after the purge? I don't think those get updated during the purge.

Boxscores and gamelogs are updated during the purge, too.

5. Will shortlists get the player IDs in them updated?

No. The GMs should write down their shortlists before the purge and restore them manually after the purge.