# Take your data with you

Your code, databases, saved files, and Config can all leave Tokay in standard formats that other hosts load. Use this page to keep a backup you control, or to move your apps somewhere else.

## What you can take

| What | Where to get it | What you get |
|---|---|---|
| Code | **Git setup** on the Code page | A Git repository with its full history |
| Databases | **Export** on the Project's **Databases** tab | The engine's own dump, or CSV files |
| Saved files | Your AI agent through Tokay MCP, or the API | The file itself, or a `.tar.gz` archive |
| Config | The Project's **Environment** tab | Every value, readable |
| Secrets | Your own password manager | Tokay doesn't show Secret values again |

Exports and file downloads need the **Export data and download files** permission on the Project. Cloning needs a role on the Code itself, or Owner or Admin on the Workspace.

## Your code

Every repository on Tokay is a standard Git repository, including code you pasted or uploaded. Open the Code page and choose **Git setup**. Pick **Add SSH key** or **Create HTTPS password**, then copy the command under **Get the code**. It clones the repository with its full history. See [SSH keys and git tokens](ssh-keys-and-git-tokens.md) for choosing between the two.

To move every branch and tag to another Git host, make a mirror clone and push it there.

```sh
git clone --mirror <your-repo-url> my-app.git
cd my-app.git
git push --mirror <new-host-url>
```

Code connected to GitHub already lives in your GitHub repository, which is its source of truth. Tokay's copy holds only the branches Tokay follows, without tags, so take that code from GitHub.

## Your databases

Open the Project's **Databases** tab, choose **Export** on a database, and pick **Native dump** or **CSV (.zip)**. When a database resource holds several databases, choose one of them or **All databases**. Tokay writes the export in the background while your database stays online, and **Download** appears when it's ready.

A native dump is what the engine's own tools write, so a host running the same engine at the same or a newer version can load it. Tokay runs PostgreSQL 18, so load a Postgres dump into PostgreSQL 18 or later.

| Engine | Native dump | Load it with |
|---|---|---|
| Postgres | A ZIP with one `pg_dump` custom format file (`.pgdump`) per database | `pg_restore` |
| MySQL | A ZIP with one `mysqldump` SQL file (`.sql`) per database | `mysql` |
| MongoDB | A `mongodump` archive (`.archive.gz`), or for several databases a ZIP of `.mongoarchive.gz` files | `mongorestore --gzip --archive=<file>` |
| Redis | An RDB snapshot (`.rdb`) | Redis itself, as its `dump.rdb` file |

Postgres dumps leave out owners and privileges, so they load under whatever user the new host gives you. MySQL dumps hold your tables, data, triggers, stored procedures, functions, and events. Views, triggers, and procedures name Tokay's database user as their definer, so on a host that won't let you set one, load the dump with MySQL Shell's `strip_definers` option or remove the `DEFINER=` clauses first.

A CSV export is a ZIP with one file per table or collection, each with a header row. It suits spreadsheets and data tools. For MongoDB, the columns come from the fields in each collection's first 1,000 documents, so use the native dump when you need every field. Redis has no CSV export because its data has no table shape.

An export can run for up to six hours, and your workspace runs one at a time. Once it's ready, Tokay keeps it for 24 hours. A newer export of the same database replaces it in either format, so download each one before you start the next. Each download link works for an hour, and a broken download resumes on it.

## Your saved files

Saved files are what your app keeps in `/tokay/data`, in directories you marked persistent, and in the Project's shared directory, `/tokay/shared`. They download through Tokay MCP and the API, so ask your AI agent, connected through [Tokay MCP](platform-mcp.md). For example, "Download everything in /tokay/data for my web Service as an archive."

Your agent lists the files, then downloads one file as it is or a folder as a `.tar.gz` archive. A file downloads at any size, and a broken download resumes where it stopped, because its link works for an hour. A folder archive is built as it downloads, so a broken one starts over. Download a very large file on its own rather than inside a folder.

See [Service files](service-files.md) for which files are saved and which reset with each deploy.

## Config and Secrets

Open the Project's **Environment** tab to see each value, or have your agent read them all through the API.

Secrets are write only. Once you save one, the dashboard and the API never show its value again, which keeps it off everyone's screen and out of Tokay's logs. Keep each Secret value in your own password manager. A lost API key can be replaced by the provider that issued it, but a key your app generated itself, such as a signing or encryption key, has no other copy, so save those first.

Database connections Tokay generated, such as `DATABASE_URL`, point at Tokay's databases and don't move. Your new host gives you its own when you load the export there.

## Set up what Tokay ran for you

Your code needs no Tokay SDK, so it runs on another host once that host provides what Tokay did. These settings live in Tokay rather than in your code, so recreate them there.

- The command each Service starts with, which Service Settings shows, and the schedule of each Scheduled Job.
- The environment variables your code reads. Tokay sets some for you, such as `NODE_ENV`, and the Service's **Environment** tab lists every one with its source.
- A storage path for saved files. If your code writes to `/tokay/data` or reads `TOKAY_DATA_DIR` or `TOKAY_SHARED_DIR`, give it a directory with the same name on the new host.
- Sign in. If your code reads Tokay's identity headers, such as `X-Tokay-Actor-Id`, the new host needs its own sign in. See [Know who is signed in](know-who-is-signed-in.md).
- Addresses. Point your custom domains at the new host, and give webhook senders the new URL in place of your `tokay.app` one.

## Let your agent do it

An AI agent connected through Tokay MCP can run the whole export for you. To get code, it clones with a git token, or uses `create_repo_download` for an archive of one version without history. For each database, `start_database_export` begins the dump and `create_database_export_download` fetches it once ready. Saved files come through `create_service_file_download`, and Config through `query_platform_graphql`.

The [Tokay MCP](platform-mcp.md) page explains how to connect an agent.

## Before you close your account or delete a workspace

Export first. Database exports and Saved files need your workspace's server, so the app offers them only while the workspace is funded. Code clones either way. If funding has already ended, email hello@tokay.io and we'll get you your data. Anything in **Recently Deleted** has to be restored before you can export it.

When you close your account from your profile, Tokay signs you out everywhere and revokes your SSH keys and git tokens. Every workspace you pay for loses its server, including ones you share with other people, and those stay stopped until another owner brings the server back. Workspaces with no other owner close with your account. Support can undo a closure for seven days. After that, those workspaces are deleted permanently, with everything in them.

When you delete a workspace from its overview page, Tokay stops its server. If you change your mind, email hello@tokay.io within 30 days, before Tokay erases its data.
