# Serialization Error: The database file version is incompatible

> DuckDB could not serialize data for a COPY, export or checkpoint, or a database file was written by an incompatible version.

Source: https://sqlly.app/errors/duckdb/serialization-error
Last updated: 2026-11-30
License: Text and data [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (credit SQLly, sqlly.app); code and SQL snippets [MIT](https://opensource.org/license/mit). [Details](https://sqlly.app/license).
Note: Quoted error message text belongs to its database vendor.

- Exception: `Serialization Error`
- Category: Extension and feature errors

Error message:

```text
Serialization Error: Loading a database file written by a different DuckDB version is not supported
```

## What it means

DuckDB database files record the storage version they were written with. A file written by a newer DuckDB cannot be opened by an older build. Since v0.10 the format is backwards compatible, so a current build reads files from older versions, but never the other way around.

The wording has changed across versions. Older builds print the classic `Serialization Error: Loading a database file written by a different DuckDB version is not supported`. DuckDB 2.x reports storage version numbers instead, for example `IO Error: Trying to read a database file with version number 69, but we can only read versions between 64 and 68.` A newer-feature file reports `Serialization Error: Failed to deserialize: ...`. All of them mean the same mismatch between the build that wrote the file and the build that opened it.

## Common causes

- An app or driver pinned to an older DuckDB opened a file that a newer tool, CLI or notebook wrote.
- Two machines, or a laptop and a container, share one file while running different DuckDB versions.
- A CI run wrote the file with the latest build and a deployment with an older library picked it up.

## How to fix it

1. Check the version of the build that fails, then upgrade it to at least the version that wrote the file:

   ```sql
   SELECT version();
   ```
2. When both versions must stay, copy the data out with the newer build and load it with the older one:

   ```sql
   COPY my_table TO 'my_table.parquet' (FORMAT PARQUET);
   ```
3. To keep sharing a file with older readers, a recent DuckDB can checkpoint against an older storage version:

   ```sql
   ATTACH 'compat.duckdb' (STORAGE_VERSION 'v1.4.0');
   ```

## Reproduce it safely

```sql
-- Not reproducible inside one build: the mismatch happens when the file is opened.
-- Check both sides of the handoff first:
SELECT version();
```

## Questions

### Can a newer DuckDB open a file from an older version?

Yes. Since v0.10 the storage format is backwards compatible, so current builds read files written by older versions.

### How do I move a database to a machine that cannot be upgraded?

Export with the newer build as Parquet or CSV and load it there, or have the newer build write the file with an older storage version using ATTACH ... (STORAGE_VERSION ...).

## Related errors

- [`IO Error`](https://sqlly.app/errors/duckdb/io-file-not-found): A file could not be opened
- [`IO Error`](https://sqlly.app/errors/duckdb/io-lock): The database file is locked by another process
- [`SQLITE_ERROR`](https://sqlly.app/errors/sqlite/sqlite-error): SQLite: SQL logic error

The code and message text are from the [DuckDB documentation](https://duckdb.org/docs/).
