Delete version history

As an Admin user, you can delete version history to reduce the size of the repository.

You can select from the versioning data that you want to delete:

Once you delete version history, the deletion is permanent. You cannot restore the data.

Deleting the entire version history on MSSQL databases require additional actions from the database administrator. For more information, see the section about deleting version history for MSSQL databases.

Delete version history for and before a specific date

Before you delete version history, make sure that all objects in the master branch are checked in.

The deletion of large version history takes time and can require a large amount of free space for temporary use. The temporarily required space is maximum the size of your workspace.

To delete version history for and before a specific date, follow the steps below:

  1. Select Manage Versioning from the Versioning ribbon item.

  2. In the Manage Versioning dialog, select option Date.

  3. Click the calendar icon in the date field and select a date.
    If you select, for example, Thursday, August 1, 2019, Tosca deletes the version history for that specific date and all versioning data before that. This also deletes all affected branches. Therefore, you can't use any branches that were created on or prior to the selected date.

Delete version history before a specific date

  1. Click Delete next to the date field.

  2. In the subsequent dialog, click Delete to confirm.

Tosca deletes the files in order, starting from the oldest one to the most recent one. This way, the version history keeps a consistent state even if the deletion times out and you have to initiate a version history deletion again. In that case, the deletion once again starts with the oldest of the remaining files.

Delete version history for and before a specific date via TC-Shell

You can delete version history for and before a specific date via TC-Shell. To do so in TC-Shell interactive mode, follow the steps below:

  1. Open your workspace in TC-Shell.

  2. Navigate to the project node.

  3. Run TC-Shell task DeleteVersionHistory.

  4. In the subsequent dialog, enter Yes to switch to date-based deletion.

  5. In the subsequent dialog, enter a date using the format dd/mm/yyyy. Tosca deletes version history for and before that date. Don't use 0 before single-digit days and months.

    For example, 4/10/2019 deletes all version history for and before October 4th, 2019.

  6. Enter Yes to confirm the deletion.

To delete version history for and before a specific date using TC-Shell script mode, run the following task: DeleteVersionHistory Yes <dd/mm/yyyy> Yes.

For example, the task DeleteVersionHistory Yes 5/8/2019 Yes deletes version history for and before August 5th, 2019.

Delete version history for and before a specific date via TC API

You can also delete version history using TC API. For more information about TC API, access the Tosca Commander API documentation.

Delete version history for and before a specific revision

Before you delete version history, make sure that all objects in the master branch are checked in.

The deletion of large version history takes time and can require a large amount of free space for temporary use. The temporarily required space is maximum the size of your workspace.

To delete version history for and before a specific revision, follow the steps below:

  1. Select Manage Versioning from the Versioning ribbon item.

  2. In the Manage Versioning dialog, select option Revision Number.

  3. Enter a revision in the revision number field.

    If you enter, for example, 150, Tosca deletes revision 150 and all revisions before that. Entering a revision deletes all affected branches. Therefore, you can't use any branches that were created with and prior to the selected revision number.

Delete version history for and before a specific revision

  1. Click Delete next to the revision number field.

  2. In the subsequent dialog, click Delete to confirm.

Tosca deletes the files in order, starting from the oldest one to the most recent one. This way, the version history keeps a consistent state even if the deletion times out and you have to initiate a version history deletion again. In that case, the deletion once again starts with the oldest of the remaining files.

Delete version history for and before a specific revision via TC-Shell

You can delete version history for and before a specific revision via TC-Shell. To do so, follow the steps below:

  1. Open your workspace in TC-Shell.

  2. Navigate to the project node.

  3. Run TC-Shell task DeleteVersionHistory.

  4. In the subsequent dialog, Tosca prompts you to decide whether you want to switch to date-based deletion. Enter No to continue with revision-based deletion.

  5. In the subsequent dialog, enter a revision number. Tosca deletes version history for and before that revision.

    For example, 14 deletes all version history for and before revision 14.

  6. Enter Yes to confirm the deletion.

To delete version history for and before a specific revision using TC-Shell in script mode, run the following task: DeleteVersionHistory No <revision number> Yes.

For example, DeleteVersionHistory No 23 Yes deletes version history for and before revision 23.

Delete version history for and before a specific revision via TC API

You can also delete version history using TC API. For more information about TC API, access the Tosca Commander API documentation.

Delete the entire version history on an MSSQL database

For MSSQL database users, the deletion of the entire version history, that is, deleting version history from the most recent revision or the current day, requires additional steps.

After the version history deletion, in MSSQL databases, the database server keeps the space that had been taken up by the version history data as reserved disk space. As a consequence, the database size doesn't decrease by deleting version history data.

In order to free up this disk space and reduce the database size, deleting the entire version history requires an additional step for MSSQL users. To complete the deletion of version history on MSSQL databases, follow the steps below:

  1. Follow the instructions to delete the entire version history:

  2. As the following operation requires database administrator rights, ask your database administrator to run the following MSSQL command on the database: DBCC SHRINKDATABASE(<the name of your database>, <the percentage of space that you want left in the database server as reserved disk space>).

    This way, your database administrator frees up space from the reserved disk space of the database server that used to be taken up by the version history data.

For example, the following command instructs the server to keep 1% of the reserved disk space in the My_DB database. This way, 99% of the reserved disk space is freed up: DBCC SHRINKDATABASE(MY_DB, 1).

For more information, see the MSSQL documentation.