> ## Documentation Index
> Fetch the complete documentation index at: https://docs.directgvr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete update paths and releases

> Use release_delete.py to remove old releases and their update paths from your server or CDN.

The `release_delete.py` script deletes a release and its update paths from your server or CDN. You need [credentials for your server or CDN](https://docs.directgvr.com/release-automation/configure-server-or-cdn.md) set up first. For every option, see [release\_delete.py](https://docs.directgvr.com/release-automation/deployment-scripts.md#release_delete-py).

## Which update paths are safe to delete

Updates aren't sequential, so a release's update paths become obsolete as soon as the release isn't assigned to any environment.

For example, release 20 is in production with update paths 19 to 20, 18 to 20, 17 to 20 and 16 to 20. You then deploy release 21 with its own update paths and promote it to production. Release 20 is no longer in any environment, so no launcher uses the paths to 20 again. They're safe to delete.

Deleting update paths never leaves players stuck. Without an update path, the launcher still only downloads the pieces that changed between the player's release and the required release. See [Updates without a delta](https://docs.directgvr.com/release-automation/updates-without-delta.md).

## Which releases are safe to delete

Don't delete a release that's assigned to an environment. Launchers pointed at that environment fail until you assign a new release.

* Don't delete a release you still want to build deltas from.
* Delete a release's update paths before the release. Otherwise the scripts can't delete the update paths and you have to remove them by hand.
* Deleting a release only removes the pieces no other release in the repository uses. If each release is 10 GB but only 1 GB of pieces is unique to the one you delete, only 1 GB is freed.

## Choose the release

Identify the release, or the release whose update paths you're deleting, with one of:

* `version`: the version you gave it when deploying, for example `"2.0.2.1"`.
* `description`: the description you gave it, for example `"Main game client v2.0.2.1"`.
* `release_id`: the release's SHA1 ID, for example `"1709ba73512217afaad521faad61e586f34e47f5"`.

You can find these in `tracker.json` or `repositoryname.history.json`:

```json tracker.json theme={null}
"s3://mybucket/": {
  "gameclient": [
    {
      "id": "a347ceba79aa29cc5b56875548e45fd7b23703f5",
      "scanTime": 1596221293,
      "version": "0",
      "description": "Main game client v0"
    },
    {
      "id": "a9b8f9fc29931fbb3df2b035c4b53d39730d6d71",
      "scanTime": 1596221384,
      "updatesFrom": [
        "a347ceba79aa29cc5b56875548e45fd7b23703f5",
        "327944e2a760bfe93f3839d4f0445f33cfa6f022"
      ],
      "version": "2",
      "description": "Main game client v2"
    }
  ]
},
```

The examples below use `--version`.

## Delete update paths

Use `--updatepaths` with `--repository` and `--sync_directory`:

```bash theme={null}
release_delete.py --updatepaths --sync_directory=s3://mybucket/ --repository=gameclient --version=3
```

The script lists the update paths it deletes. Update paths are stored in `sync_directory/repositoryname/delta/target_release_id/source_release_id/`. The script deletes the folders' contents but not the folders.

## Delete a release

> [!TIP]
>
> Add `--dry_run` to see which files would be deleted without deleting them.

Use `--release` with `--repository` and `--sync_directory`:

```bash theme={null}
release_delete.py --release --sync_directory=s3://mybucket/ --repository=gameclient --version=3
```

The script lists the release it deletes. A release's pieces are spread across the subfolders of `sync_directory/repositoryname/pieces/`. As with deltas, only the folders' contents are deleted.

## Related

* [Create delta update paths](https://docs.directgvr.com/release-automation/create-delta-update-paths.md)
* [Create environments and promote releases](https://docs.directgvr.com/release-automation/environments-and-promotion.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.