Upgrade to TeamForge 8.0 and later fails if the field 'team' already exists. How do I resolve this?

While upgrading to TeamForge 8.0 (or later) you may encounter an error stating that the field team already exists for the tracker(s).

This is because if the trackers in your project already have a field with the name team, it conflicts with the Team feature introduced in TeamForge 8.0. This error occurs while running the migration script migrate.py. To resolve the issue, do the following and then run the migrate.py script again:
  1. Identify the tracker(s) where the team field is present by running the following script:.
    • For the folder_layout table:
      • select folder_layout.id, field_name, title,folder_id tracker_id from folder_layout, folder where field_name = 'team' and folder_id like 'tracker%' and folder.id = folder_layout.folder_id;
    • For the field table:
      • select field.id, name, title, folder_id from field, folder where name='team' and folder_id like 'tracker%' and field.folder_id = folder.id;
  2. Rename the field team as original_team by running the following script::
    • For the folder_layout table:
      • update folder_layout set field_name='original' || '_team' where field_name='team';
    • For the field table:
      • update field set name='original' || '_team' where name='team';
  3. Verify the newly renamed fields by running the following script:
    • For the folder_layout table:
      • select folder_layout.id, field_name, title,folder_id tracker_id from folder_layout, folder where field_name like '%team' and folder_id like 'tracker%' and folder.id = folder_layout.folder_id;
    • For the field table:
      • select field.id, name, title, folder_id from field, folder where name like '%team' and folder_id like 'tracker%' and field.folder_id = folder.id;
  4. Re-run migrate.py.
    Important: Before re-running this script, make sure you delete the ctf72_ctf80 folder (which was created the first time you ran the migration script), because every time you run the script, this folder gets created.