> For the complete documentation index, see [llms.txt](https://knowledge.illumina.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledge.illumina.com/software/basespace-cli/software-basespace-cli-faq-list/000005447.md). Agents can also search and read this documentation through its [MCP server](https://knowledge.illumina.com/~gitbook/mcp).

# How to archive and restore data in BaseSpace using BaseSpace Command Line Interface (CLI) commands?

**Archiving runs and datasets**

Use the `archive` command to send data to long-term storage:

`$ bs archive run -i <Run ID>$ bs archive dataset -i <Dataset ID>`

Use the `IsArchived` field to check whether runs or datasets have been archived:

`# show all archived runs$ bs list runs --filter-field IsArchived --filter-term true`

Archiving runs will only move the `Data/` directory of run files, while InterOp and other metadata will remain accessible. For datasets, all files will be archived but metadata including any dataset attributes will remain available.

```
**Restoring data from the archive**  
```

```
To regain access to archived data, use the unarchive command:  
$ bs unarchive run -i <Run ID>  
$ bs unarchive dataset -i <Dataset ID>  

```

**Note**: the restore process can take up to several days to complete. The `IsArchived` field will remain `true` until the data has been fully restored.

### **Bulk archival**

As with other CLI commands, it it easy to combine `archive` with the `list` command for powerful results.

`# archive all runs which are over a year old $ bs list runs --older-than 1y --terse | xargs -n1 bs archive run -i # archive all datasets in a given project $ bs list datasets --project-id 123456 --terse | xargs -n1 bs archive dataset -i`

`Note that all archive and unarchive actions will still follow the standard costs per transfer.`

\
\
\ <br>

|                                                                                                                                                                                                                                                                                                                                                                 |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| *For any feedback or questions regarding this article (Illumina Knowledge Article #5447), contact Illumina Technical Support* [*techsupport@illumina.com*](mailto:techsupport@illumina.com?subject=Question%2FFeedback%20Regarding%20Illumina%20Knowledge%20Article%20#000005447%20-%20Software%20\&body=Dear%20Illumina%20Technical%20Support,%0D%0A%0D%0A)*.* |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://knowledge.illumina.com/software/basespace-cli/software-basespace-cli-faq-list/000005447.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
