> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.15/customize-cortex-xsoar/customize-and-configure-cortex-xsoar/manage-data/archive-artifacts-and-attachments.md).

# Archive Artifacts and Attachments

Archive Cortex XSOAR 6.15 artifacts and attachment folders to reduce storage use.

We recommend archiving artifacts and attachments to facilitate migration and data recovery processes.

Locate the folders that reside in the following location (where Cortex XSOAR is installed), `/var/lib/demisto/artifacts/` and `/var/lib/demisto/attachments/`.

{% hint style="info" %}

### Note

Although the folders reside in `/var/lib/demisto/artifacts/` and `/var/lib/demisto/attachments/`, **DO NOT** save the backup folders under `/var/lib/demisto/`.
{% endhint %}

Follow these steps to create artifact and attachment archive folders.

1. Stop the Cortex XSOAR service using the following command.

   `$ sudo service demisto stop`
2. Create directories to hold the archived artifacts and attachments. For example:

   `mkdir -p /var/lib/demisto-archive/artifacts`

   `mkdir -p /var/lib/demisto-archive/attachments`
3. Navigate to the `/var/lib/demisto-archive/` folder.

   `cd /var/lib/demisto-archive/`
4. Find the artifacts and attachments you want to save and compress in the archive directories. For example, the following commands archive artifacts and attachments that are older than 250 days.

   For artifacts:

   `find /var/lib/demisto/artifacts -type f -mtime +250 | xargs -I% sh -c 'tar -rvf artifacts/artifactsArchive.tar.gz % && rm %'`

   For attachments:

   `find /var/lib/demisto/attachments -type f -mtime +250 | xargs -I% sh -c 'tar -rvf attachments/attachmentsArchive.tar.gz % && rm %'`
5. Start the Cortex XSOAR service.

   `$ sudo service demisto start`


---

# 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 dynamically by asking a question.

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

```
GET https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.15/customize-cortex-xsoar/customize-and-configure-cortex-xsoar/manage-data/archive-artifacts-and-attachments.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 `build a script that syncs our docs to a CMS` 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.
