Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
goodroot committed Jul 25, 2024
1 parent 605e845 commit 76d43fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 178 deletions.
166 changes: 0 additions & 166 deletions reference/sql/backup.md

This file was deleted.

25 changes: 13 additions & 12 deletions reference/sql/snapshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@ sidebar_label: SNAPSHOT
description: SNAPSHOT SQL keyword reference documentation.
---

Prepares the database for a full backup or a filesystem (disk) snapshot.
Prepare the database for a full backup or a filesystem (disk) snapshot.

_Are you looking for a detailed guide on how to create backups and restore them? Check out our [Backup and Restore](/docs/operations/backup/) guide!_

## Syntax

![Flow chart showing the syntax of the SNAPSHOT keyword](/img/docs/diagrams/snapshot.svg)


:::caution

QuestDB currently does not support creating snapshots on Windows.
If you are a Windows user and require backup functionality, please let us know by [commenting on this issue](https://github.com/questdb/questdb/issues/4811).

:::
If you are a Windows user and require backup functionality, please [comment on this issue](https://github.com/questdb/questdb/issues/4811).

**Tip: Are you looking for a detailed guide on how to create backups and restore them? Check out our [Backup and Restore](/docs/operations/backup/) guide!**
:::

## Snapshot process

Database snapshots may be used in combination with filesystem snapshots or
together with file copying for a full data backup. Collecting a snapshot
involves the following steps:
Expand All @@ -30,22 +31,21 @@ involves the following steps:
flush the committed data to disk.
2. Start a filesystem snapshot or copy the
[root directory](/docs/concept/root-directory-structure/) to the backup
location on the disk.
location on the disk.
learn how to create a filesystem snapshot on the most common cloud providers.
3. Run `SNAPSHOT COMPLETE` statement to release the reader locks and delete the
metadata file copies.


## Snapshot recovery

In case of a full backup, you should also delete the old root directory and copy
the files from your backup to the same location or, alternatively, you can point
the database at the new root directory.

When the database starts, it checks the presence of a file named `_restore` in
the root directory. If the file is present, the database runs a
snapshot recovery procedure restoring the metadata files from the snapshot. When
this happens, you should see the following in the server logs:
When the database starts, it checks for the presence of a file named `_restore` in the root directory. If the file is present, the database runs a
snapshot recovery procedure restoring the metadata files from the snapshot.

When this happens, you should see the following in the server logs:

```
2022-03-07T08:24:12.348004Z I i.q.g.DatabaseSnapshotAgent starting snapshot recovery [trigger=file]
Expand Down Expand Up @@ -76,4 +76,5 @@ SNAPSHOT COMPLETE;
```

## Further reading
- [Backup and Restore](/docs/operations/backup/) - Detailed guide on how to create backups and restore them.

- [Backup and Restore](/docs/operations/backup/) - Detailed guide on how to create backups and restore them.

0 comments on commit 76d43fb

Please sign in to comment.