# Getting Your Content Out: Data Portability and Exit

> Source: https://agilitycms.com/docs/overview/data-portability-and-exit

Your content is yours, and you should know how to take it with you before you commit to any platform. This page lists every documented way to get content, models, pages and assets out of Agility, what each one covers, and how to put together a full export.

The same tools serve everyday needs too: backups you control, copying content between instances, feeding a data warehouse, or testing a migration.

## What's already yours

In a headless setup, a lot never lives in the CMS in the first place. **Your website or app code, its hosting and its integrations belong to you and run on your infrastructure.** Leaving Agility means moving content, not rewriting the systems around it from scratch.

## Ways to get data out

| Method | What it covers | Format | Best for |
| --- | --- | --- | --- |
| [Agility CLI](/docs/developers/cli) `pull` | Models, containers, page models (templates), content, pages, assets, galleries, sitemaps and URL redirections, per locale | JSON files and asset files in a local `agility-files/` folder | A full snapshot of an instance in one command |
| [Content Sync API](/docs/developers/content-sync-api) | Every content item and page, per locale, then only what changed | JSON, same item shape as the Fetch API | Keeping a continuously updated copy |
| [Content Fetch API](/docs/developers/content-fetch-api) | Items, lists, pages, sitemaps (flat and nested), content models and URL redirections | JSON | Targeted reads and verification |
| Management API and SDKs ([JavaScript](/docs/javascript/management-sdk/getting-started), [.NET](/docs/dotNet/management-sdk-dotnet-intro)) | Models, containers, content items, pages, the media list, galleries, and item and page history | JSON through the SDKs | Scripted exports with full control, including staging content and history |
| [Content list export](/docs/editors/importing-and-exporting) in the Content Manager | One whole content list, with each content model on its own worksheet | Excel (.xlsx) | Quick exports for review, editing or translation |
| [URL redirection export](/docs/editors/url-redirections) | All URL redirections | Excel (.xlsx) | Keeping your redirect map for SEO |

### The CLI: a full snapshot

`agility pull` downloads an instance's content and structure to local files. You need an Org Admin, Instance Admin or Manager role.

```bash
agility pull --sourceGuid="your-instance-guid" --locales="en-us,fr-ca"
```

Things to know:

- **It pulls staging data.** CLI 1.1.0 always pulls preview (staging) content, including unpublished work, and has no option to pull published content instead. For a published copy, use the [Content Sync API](/docs/developers/content-sync-api) or the [Content Fetch API](/docs/developers/content-fetch-api) with a Fetch (live) API key.
- **Scope it if you need to.** `--elements` limits the pull to some of `Models,Galleries,Assets,Containers,Content,Templates,Pages,Sitemaps,UrlRedirections`. All of them are pulled by default.
- **It runs unattended.** With a [Personal Access Token](/docs/developers/personal-access-tokens) and `--headless=true`, a pull can run in CI on a schedule.

The output folder layout is described in the "File structure" section of the [CLI guide](/docs/developers/cli).

### The Sync API: a copy that stays current

The [Content Sync API](/docs/developers/content-sync-api) returns all content items and pages the first time you call it (`syncToken=0`), then only what changed. Items and pages have separate endpoints and tokens, and each locale is synced separately. Deleted and unpublished items come back with a deleted state so your copy can remove them. [Content Sync Explained](/docs/developers/content-sync-explained) covers the token lifecycle.

### The Management API: everything, including history

The Management API and its SDKs can read models, containers, content items, pages and page models, list the media library, and read the version history of individual content items and pages. Use it when you need staging content, history, or a format of your own design. [Migrating Content into Agility with an AI Agent](/docs/developers/migrating-content-with-an-ai-agent) shows the same SDK used in the other direction, which is a good model for an export script.

## Assets

- **The CLI** downloads asset files along with their metadata, and galleries.
- **The Management API** lists every asset in the media library with its URL, so a script can download them. See [Assets](/docs/javascript/management-sdk/assets) in the JavaScript Management SDK docs.
- **Asset URLs** in your content point at the asset CDN, so when you move, plan to rewrite those URLs in your content and redirect any public asset links that matter for SEO.

## Version history

Content and page history is available through the Management API (the JavaScript SDK's `getContentHistory`, for example). The CLI copies only the current version of each item, not its history. If you need history, export it with a script.

## A full export, step by step

1. **Inventory first.** List your locales, sitemaps, content lists and approximate item counts, so you can check the export against them.
2. **Pull everything with the CLI.** This gives you the staging (preview) version of everything, including unpublished work. If you also need the published version, read it with the Content Sync API or the Fetch API using a Fetch (live) API key.
3. **Optionally, export URL redirections** from the URL Redirections page as an Excel copy. The CLI pull already includes them.
4. **Export history** with a Management API script, if you need it.
5. **Verify counts.** Compare the number of items per list and per locale, and the number of assets, against your inventory. Check that linked content still points at the right items.
6. **Store the export securely.** It contains everything your editors have created.

## What to ask before you sign

Some exit questions are contractual rather than technical. Ask your Agility contact, and get the answers in writing:

- How long is data kept after a subscription ends, and how is it deleted?
- Is assisted export available, and on what terms?
- Which other data (users, roles, workflow settings, comments, audit logs) can be exported, and how?

## Related

- [AgilityCLI (Command Line Interface)](/docs/developers/cli)
- [Content Sync Explained](/docs/developers/content-sync-explained)
- [Field Types and What the APIs Return](/docs/developers/field-types-api-reference)
- [Disaster Recovery & Business Continuity](/docs/owners-admins/disaster-recovery-and-business-continuity)

---

## Related pages

- [Evaluating Agility](https://agilitycms.com/docs/overview/evaluating-agility.md)
- [What Your Team Builds vs What Agility Provides](https://agilitycms.com/docs/overview/what-your-team-builds-vs-what-agility-provides.md)
- [How Agility Works: A 10-Minute Architecture Tour](https://agilitycms.com/docs/overview/how-agility-works.md)
- [Is Agility Right for Your Project? When It Fits and When It Doesn't](https://agilitycms.com/docs/overview/is-agility-right-for-your-project.md)
- [Choosing a Headless CMS: A Capability Checklist and Questions to Ask Any Vendor](https://agilitycms.com/docs/overview/choosing-a-headless-cms.md)
- [Run a Two-Week Proof of Concept](https://agilitycms.com/docs/overview/run-a-two-week-proof-of-concept.md)
- [Headless, Hybrid or Traditional: Choose Your Delivery Model](https://agilitycms.com/docs/overview/choose-your-delivery-model.md)
- [Building the Replatforming Business Case](https://agilitycms.com/docs/overview/replatforming-business-case.md)
- [Evaluate Agility with an AI Agent in 30 Minutes](https://agilitycms.com/docs/overview/evaluate-agility-with-an-ai-agent.md)

Index of every docs page: https://agilitycms.com/docs/llms.txt
