# Project export and import

System administrators can export project configuration and metadata, then create a project copy through the administration API.

使用指南 · 模块: admin · 管理人员 · 部署形态：资料未说明 · 已确认产品版本：资料未说明 · 来源：现有文档

Project export saves data source configuration, connection details, schema, table and field metadata, and training data as JSON. A system administrator can import this file into an environment running the same version to create a new project copy.

**This is not a complete project backup.** It excludes business data in databases, Workbook data and dedicated metadata, uploaded source files, conversations, agents, canvases, dashboards, members, permission settings, and AI Search value indexes. For full environment backup and recovery, see [Version upgrades and migration](https://docs.asktable.com/en/deploy/migration).

**Warning**

The export contains data source connection accounts and **decrypted database passwords**. Treat it as a credentials file: restrict access and transfer it through controlled channels. Do not upload it to public repositories, support tickets, or group chats. Passwords are encrypted again during import, but the exported JSON file still contains plaintext passwords.

## Permissions and preparation

- **Export through the interface**: You need the system administrator role (`SYS_ADMIN`) and Owner or Admin access to the current project to enter project settings and see the export action. Project administrator access alone does not grant this system export capability.
- **Import through the API**: Use a system API Key or an access token obtained by signing in as a system administrator. A project API Key cannot access this endpoint.
- **Matching versions**: Source and target environments should use the same AskTable version and database migration version. The export has no complete data structure version marker and provides no cross-version format conversion. Do not treat a historical JSON file as a cross-version migration package.
- **Target organization**: Import creates a new project in the target organization and remains subject to the organization's read-only state and project capacity limits. Prepare the target organization ID and specify it explicitly with `X-Org-Id`.

## Export through the interface

1. Sign in with the permissions above, enter the target project, and open **Project settings**.
2. In **System Admin**, click **Export Project**. Read the notice about connection details and passwords, then confirm.
3. The browser downloads `export_<projectID>_<timestamp>.json`. Keep the original file and use its complete content for import; do not reconstruct the JSON structure by hand.

The main exported content is:

| Content                      | Scope                                                                                                                 |
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Basic project information    | Project name and source project ID                                                                                    |
| Data sources and connections | Data source configuration, connection addresses, accounts, passwords, and other connection details                    |
| Metadata                     | Schema, table, and field structures and descriptions for regular data sources; excludes dedicated Workbook structures |
| Training data                | Training question-and-answer data in the project                                                                      |

Field and training-data vectors are not exported. They are regenerated from descriptions and questions during import. The target environment still needs its own access to source databases and external services. Uploaded files, Workbooks, and value indexes require separate migration or rebuilding; this JSON alone cannot restore them.

## Import through the administration API

There is currently no project import interface. An administrator submits the complete export to `POST /api/v1/sys/projects/import`. The request body is the JSON object from the file, not a file upload form, and needs no additional wrapper field.

This example uses the access URL of a standard Docker deployment. Replace the placeholders with the target instance address, administrator credential, and target organization ID, and point `project-export.json` to the actual export file. For a subpath deployment, add the deployment subpath before `/api`.

```bash
curl --request POST 'https://<target-instance-address>/api/v1/sys/projects/import' \
  --header 'Authorization: Bearer <system-API-Key-or-system-administrator-access-token>' \
  --header 'X-Org-Id: <target-organization-ID>' \
  --header 'Content-Type: application/json' \
  --data-binary '@project-export.json'
```

A successful response returns the new project's `project_id`. Import generates new resource IDs without overwriting the original project, and adds a copy suffix if the name conflicts. The new project uses private access and does not copy source members or permissions. When a system administrator access token is used and that administrator belongs to the target organization, the administrator becomes the new project Owner; otherwise, the target organization's Owner takes that role.

Import regenerates field and training-data vectors, so the target environment needs working embedding model configuration. If import fails, use the API error to check credentials, target organization state, capacity, versions, and model configuration before proceeding. Do not include the complete request body with passwords in troubleshooting records.

## Check after import

1. Find the new project returned in the response within the target organization. Check its name, data sources, and metadata.
2. Check which databases the connections still point to, whether the target environment can reach them, and whether their permissions are appropriate. Import does not copy external databases or automatically change connection addresses.
3. Configure access for the required members again, and separately handle resources that were not exported, such as files, Workbooks, and agents.
4. Ask actual questions to verify connections, field interpretation, and training data before handing the project over to the team.
