> For the complete documentation index, see [llms.txt](https://docs.sdv.dev/sdv/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sdv.dev/sdv/sampling/export.md).

# Exporting Synthetic Data

Export your synthetic data back into a similar format as the original data or into a new format using the functions describe on this page.

## ❖ Export to a Database

{% hint style="info" %}
❖ **SDV Enterprise Bundle**. This feature is available as part of the **AI Connectors Bundle**, an optional add-on to SDV Enterprise. For more information, please visit the [AI Connectors Bundle](/sdv/explore/sdv-bundles/ai-connectors.md) page.
{% endhint %}

Write your synthetic data into a database to use for downstream applications. Many users choose to write to a database in a lower environment for testing and development. You can also append the synthetic data to an existing database.

We recommending using the same AI Connector you used for importing training data. This connector already knows your original database schema, so it will create the same schema when exporting synthetic data. Be sure to set your export config, so the connector knows where to write the synthetic data.

For more information, see [Connect Your Database](/sdv/integration/db.md) docs.&#x20;

```python
connector.set_export_config(...)
connector.export(data=synthetic_data, mode='write')
```

{% hint style="info" %}
**Exporting to a different type of database?** Create a new connector based on the type of database. Then, set its export config and complete the export.
{% endhint %}

## Write Locally

We recommend using the same data handler that you used for importing training data. This writes multiple files corresponding to each table you have synthesized. For more information, see the [Import Local Data](/sdv/integration/local.md) docs.

```python
connector.write(
  synthetic_data,
  folder_name='project/synthetic_data',
  to_csv_parameters={
      'encoding': 'latin-1',
      'index': False
  }
  mode='x')
)
```

{% hint style="info" %}
**Write to a different type of file?** Create a new handler based on the desired file format and then perform the write.&#x20;
{% endhint %}

{% hint style="info" %}
**Write other file formats directly from pandas.** The SDV uses the [pandas library](https://pandas.pydata.org/) for data manipulation and synthesizing. Pandas offers native support for many other types of files. For more information, see the [pandas reference](https://pandas.pydata.org/docs/reference/io.html).

If you have a multi-table dataset, be sure to iterate through all the tables of your multi-table dataset. Pandas typically writes one table at a time.

```python
guests_table = synthetic_data['guests']
guests_table.to_parquet('guests.parquet')

hotels_table = synthetic_data['hotels']
hotels_table.to_parquet('hotels.parquet')
```

{% endhint %}


---

# 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 current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sdv.dev/sdv/sampling/export.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
