---
title: "Import and export"
description: "Dump a database to a file with export() and restore it from a file with import() in the Rust SDK."
canonical_url: "https://surrealdb.com/docs/reference/rust/concepts/import-and-export"
sdk: "Rust SDK"
sdk_version: "4.0.1"
surrealdb_version: "4.x"
last_modified: "2026-11-24T05:29:47Z"
---

> Full SurrealDB documentation index: https://surrealdb.com/docs/llms.txt

# Import and export

Dump a database to a file with export() and restore it from a file with import() in the Rust SDK.

The Rust SDK can write the contents of a database to a file and restore a database from a file. Each method has its own page with its arguments and examples.

| Method | Description |
| --- | --- |
| [`db.export()`](/docs/reference/rust/methods/export.md) | Dumps the database contents to a file |
| [`db.import()`](/docs/reference/rust/methods/import.md) | Restores the database from a file |
