---
title: "Export Your Library"
description: "Back up your notes and books before you switch devices."
slug: export-library
sidebar_position: 3
tags: [export, backup]
draft: false
---

import Callout from '@site/src/components/Callout';

Shelfmark is a fictional reading app used for this test. This page explains how to export your library, check the files, and move them to a new device. A full export takes 3–5 minutes and produces a folder of 10–20 MB for a typical library.

## Before you start

Open **Settings → Export (beta)** and pick an empty folder. If you have never exported before, read the [glossary section](#keep-one-glossary-for-the-whole-book) first, because two of the terms below have a specific meaning in Shelfmark.

<Callout type="warning" title="Back up first">
  Exporting does not delete anything, but close other apps that sync the same folder.
</Callout>

## Run the export

1. Click **[Export](./export-options.md)** to open the dialog.
2. Choose a format:
   - `epub` keeps chapters and covers.
   - `md` writes one Markdown file per book.
3. Press <kbd>Enter</kbd> to start.

You can also run the export from a terminal:

```bash
# Export every book as EPUB into ~/shelfmark-backup
shelfmark export --format epub --out ~/shelfmark-backup
```

The export writes a settings file next to the books:

```yaml
library:
  name: "My books"   # shown in the sidebar
  sort: title
```

## Check the exported files

| File | What it contains | Required |
| --- | --- | --- |
| `library.json` | Book list, reading positions | Yes |
| `notes/` | Highlights and notes, one file per book | No |
| `covers/` | Cover images | No |

Each note keeps its *location* and its *color*.  
A note without a location is listed at the end of its book.

- [x] Open `library.json` and confirm the book count.
- [ ] Spot-check three notes against the original book.

:::tip
If a cover is missing, re-run the export with `--covers`. See the [EPUB 3.3 specification](https://www.w3.org/TR/epub-33/ "EPUB 3.3") for how covers are stored.
:::

![Folder layout after an export](./img/export-folder.png)

## Keep one glossary for the whole book

A *shelf* is a group of books; a *stack* is a shelf that syncs[^sync]. Use the same translation for each term across every page, and record it in the [project glossary][glossary].

{/* Translator note: "Shelfmark" is a product name. Do not translate it. */}

[glossary]: ./glossary.md#terms "Glossary"

[^sync]: Syncing needs an account. See the [CommonMark help page](https://commonmark.org/help/) for Markdown syntax.
