# Versions, drafts and previews

Source: https://dropshelf.ai/docs/use/versions

How every upload to a drop becomes a numbered version, and how to preview a draft, publish it and go back to an earlier version.

Every upload to a dropshelf drop is a new version, numbered `v1`, `v2` and so on. The drop's address
serves one of them, the published version. This page is for the owner and editors of a drop, who
upload, preview and publish its versions.

## Versions and their states [#versions-and-their-states]

A drop numbers its versions in the order they arrive, and never reuses a number. A failed upload
keeps its number, so the list shows it beside the ones that worked.

To see a drop's versions, open the drop, select **Settings** and expand **Versions**. Each row gives
the number, when it was uploaded, who uploaded it, where from, and its size. The state is one of:

- **Published**: the version the drop's address serves.
- **Draft**: uploaded and never published.
- **Previous**: published once, and replaced since.
- **Uploading**: still arriving.
- **Failed**: the upload did not finish. The reason follows the word.
- **No longer available**: its files were removed, so you can neither preview nor publish it.

The **Settings** tab is there for the owner, editors and admins. Other members see the drop's
**Overview** only.

## Add a new version as a draft [#add-a-new-version-as-a-draft]

A new version from the dashboard always arrives as a draft. Visitors keep seeing the published
version until you publish the new one.

To add a new version:

1. Drag the folder onto the drop's card or row on **My drops**. Or open the drop, select
   **Settings**, and select **New version** beside **Versions**, then pick the folder.
2. Wait for the upload to finish. The drop shows a draft badge, such as **v5 draft**.

From the CLI, `dropshelf push` on a drop that already has a version also makes a draft. Add
`--publish` to make it live at once. The [CLI reference](/docs/reference/cli#push) lists the flags.

## Preview a version [#preview-a-version]

Each kept version has an address of its own, `v<n>--<name>.drop.example.com`. Version 7 of a drop
called `blog` is at `v7--blog.drop.example.com`. Every link inside it stays on that version.

To preview a version:

1. Open the drop and select **Settings**.
2. Under **Versions**, select **Preview** beside the version. The drop's viewer shows that version,
   with a banner above it.
3. Select **Back to published** when you are done.

A preview shows that version's files with the drop's live data and uploaded assets. The drop's own
address keeps serving the published version to everyone, you included, so there is nothing to switch
back. Only the owner, editors and admins can open a preview address. To anyone else it answers as if
no drop were there.

## Publish a draft or an earlier version [#publish-a-draft-or-an-earlier-version]

Publishing makes a kept version the one the address serves. Publishing a **Previous** version is
how you go back to it.

To publish a version:

1. Open the drop and select **Settings**.
2. Under **Versions**, select **Publish** beside the version.

The version goes live, and the one it replaces becomes **Previous**. The drop's retention starts
again from now, as it does for every publish.

For a draft on your own drop, there are shorter ways. Select **Publish** on its row in **My drops**,
or the publish button in the card at the top of the drop's panel.

Sometimes another version was published after the one you are publishing was started. The dashboard
then names who published it, when, and which files changed. Select **Publish anyway** to replace it,
or **Cancel** to keep it.

Your admin may limit how much storage each member's published versions take. A publish counts the
version against the owner's limit, so it is refused when the limit would be passed.
From the CLI, `dropshelf publish <version>` publishes a version; see the
[CLI reference](/docs/reference/cli#publish).

## How many versions are kept [#how-many-versions-are-kept]

Your admin decides how many earlier published versions and how many drafts each drop keeps. By
default it is five of each, counted apart. The line at the top of **Versions** says what your
instance keeps. [Set limits and retention](/docs/self-host/configure/limits-and-retention) covers
the setting.

Beyond those counts, the oldest version's files are removed shortly after. Its row stays, marked
**No longer available**. Kept versions and drafts do not count against your storage: only the
published version does.

## Notes on a version [#notes-on-a-version]

A note is one line on what a version changes, up to 200 characters. You add it when you upload from
the CLI or through an agent, not from the dashboard.

To add a note from the CLI, pass `--note`:

```bash
dropshelf push --note "<what-changed>"
```

The note appears under the version in **Versions**, and in the message about a version published
since. A draft's note is visible only to the people who can manage the drop.

## Next steps [#next-steps]

- [Publish a drop](/docs/use/publish)
- [Share a drop](/docs/use/share)
- [Retention and Forever](/docs/use/retention)
- [The dropshelf CLI](/docs/agents/cli)
