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

# Exporting data

> See how to export your code, files and service data.

As an Upsun user, your code and data belong to you.
At any time, you can download your site's data for local development, to back up your data, or to change provider.

For a full overview of all data categories, classifications, and export methods, see the [Data Register](https://developer.upsun.com/docs/registry.md).

## Before you begin

You need:

* [Git](https://git-scm.com/downloads)
* An Upsun account
* Code in your project
* Optional: the [Upsun CLI](https://developer.upsun.com/cli.md)

## 1. Download your app's code

Your app's code is maintained through the Git version control system.

To download your entire app's code history:

> [tab] Using the CLI
>
> 1. List all your projects by running the following command:
>
>    ```bash theme={null}
>    upsun projects
>    ```
>
> 2. Retrieve the project you want to back up by running the following command:
>
>    ```bash theme={null}
>    upsun get <PROJECT_ID>
>    ```

> [tab] Using Git
>
> 1. In the [Console](https://console.platformsh.site/), open your project and click \*\*Code \*\*.
> 2. Click **Git**.
> 3. To copy the command, click \*\* Copy\*\*.
>    The command is similar to the following:
>
>    ```bash theme={null}
>    git clone abcdefgh1234567@git.eu.platformsh.site:abcdefgh1234567.git project-name
>    ```

## 2. Download your files

Some files might not be stored in Git,
such as data your app writes [in mounts](https://developer.upsun.com/docs/configure-apps/image-properties/mounts.md).

You can download your files [using the CLI](https://developer.upsun.com/docs/development/file-transfer.md#transfer-files-using-the-cli) or [using SSH](https://developer.upsun.com/docs/development/file-transfer.md#transfer-files-using-an-ssh-client).

### Network Storage mounts

If your project uses a [Network Storage service](https://developer.upsun.com/docs/add-services/network-storage.md)
(mounts with `source: service`), the data lives in a dedicated service container rather than in the app container itself.
The download process is the same as for local mounts — use the CLI or rsync over SSH — but you need to target the path
as it is mounted inside the app container.

For example, to download a `web/uploads` network mount using the CLI:

```bash Terminal theme={null}
upsun mount:download --mount web/uploads --target ./local-uploads
```

## 3. Download data from services

> [!NOTE]
>
> While Upsun Cloud supports customer data portability, certain technical characteristics of cloud-native platforms may affect migration workflows.
>
> > [accordion] Volume limits
> >
> > Upsun Cloud does not impose platform-specific restrictions on the volume of customer data that can be exported. However, exports may be subject to:
> >
> > * Network bandwidth limitations
> > * Resource constraints of the originating environment
> > * Service-specific export mechanisms
>
> > [accordion] Transformation requirements
> >
> > Some exported data may require reconfiguration before being used in another environment. Examples include:
> >
> > * Environment-specific configuration values
> > * Infrastructure definitions referencing Upsun Cloud-specific services
> > * Deployment configuration files tailored to Upsun Cloud's build and runtime model
>
> > [accordion] Compatibility
> >
> > Upsun Cloud supports widely adopted open formats and standards to maximize portability. However:
> >
> > * Infrastructure definitions written for Upsun Cloud may require adaptation when deployed on other cloud providers
> > * Service configuration may need adjustment depending on the destination platform's capabilities
> > * Some operational metadata used internally by Upsun Cloud is platform-specific and may not be applicable in external environments
>
> These limitations are typical for platform-as-a-service environments and do not prevent customers from exporting their application data and code.

The mechanism for downloading from each service varies.

For services designed to hold non-persistent data in memory only — such as [ephemeral Redis](https://developer.upsun.com/docs/add-services/redis.md#ephemeral-redis),
[ephemeral Valkey](https://developer.upsun.com/docs/add-services/valkey.md), [Memcached](https://developer.upsun.com/docs/add-services/memcached.md),
or [Solr](https://developer.upsun.com/docs/add-services/solr.md) —
it's generally not necessary to download data as it can be rebuilt from the primary data store.

For services designed to hold persistent data, see the instructions for each service below.

### Relational databases

* [MySQL / MariaDB](https://developer.upsun.com/docs/add-services/mysql#exporting-data)
* [PostgreSQL](https://developer.upsun.com/docs/add-services/postgresql#exporting-data)

### Document and time-series databases

* [MongoDB](https://developer.upsun.com/docs/add-services/mongodb.md#exporting-data)
* [InfluxDB](https://developer.upsun.com/docs/add-services/influxdb.md#export-data)
* [ClickHouse](https://developer.upsun.com/docs/add-services/clickhouse.md#exporting-data)

### Search engines

* [Elasticsearch](https://developer.upsun.com/docs/add-services/elasticsearch.md#exporting-data)
* [OpenSearch](https://developer.upsun.com/docs/add-services/opensearch.md#exporting-data)

### Key-value stores (persistent)

* [Redis (persistent)](https://developer.upsun.com/docs/add-services/redis.md#exporting-data-persistent)
* [Valkey (persistent)](https://developer.upsun.com/docs/add-services/valkey.md#exporting-data-persistent)

### Message brokers

* [RabbitMQ](https://developer.upsun.com/docs/add-services/rabbitmq.md#exporting-data)
* [Kafka](https://developer.upsun.com/docs/add-services/kafka.md#exporting-data)

### Vector databases

* [Qdrant](https://developer.upsun.com/tutorials/self-hosted/qdrant.md#exporting-data)
* [Chroma](https://developer.upsun.com/tutorials/self-hosted/chroma.md#exporting-data)

## 4. Get environment variables

Environment variables can contain critical information such as tokens or additional configuration options for your app.

Environment variables can have different prefixes:

* Variables beginning with `env:` are exposed [as Unix environment variables](https://developer.upsun.com/docs/development/variables#top-level-environment-variables).
* Variables beginning with `php:` are interpreted [as `php.ini` directives](https://developer.upsun.com/docs/development/variables#php-specific-variables).

All other variables are [part of `$PLATFORM_VARIABLES`](https://developer.upsun.com/docs/development/variables/use-variables#use-provided-variables).

To back up your environment variables:

> [tab] Using the CLI
>
> 1. Get the variable's values by running the following command:
>
>    ```bash theme={null}
>    upsun ssh -- 'echo $PLATFORM_VARIABLES | base64 -d | jq'
>    ```
>
>    Note that you can also get all the environment variable values by running the following command:
>
>    ```bash theme={null}
>    upsun ssh -- env
>    ```
>
> 2. Store the data somewhere secure on your computer.

> [tab] In the Console
>
> 1. In the [Console](https://console.platformsh.site/), open your project and click \*\*\*\*.
> 2. Click \*\*Project Settings \*\*.
> 3. Click **Variables** and access your variable's values and settings.
> 4. Store the data somewhere secure on your computer.
>
> Note that in the Console, you can't access the value of variables that have been [marked as sensitive](https://developer.upsun.com/docs/development/variables/set-variables.md#variable-options).
> Use the CLI to retrieve these values.

## What's next

* Migrate data from elsewhere [into Upsun](https://developer.upsun.com/tutorials/migration.md).
* Migrate to [another region](https://developer.upsun.com/docs/projects/region-migration.md).
* To use data from an environment locally, export your data and set up your [local development environment](https://developer.upsun.com/docs/development/local).


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