Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reindexing doc #2393

Merged
merged 6 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [Sparrow Wallet](guides/collecting/sparrow-wallet.md)
- [Testing](guides/testing.md)
- [Moderation](guides/moderation.md)
- [Reindexing](guides/reindexing.md)
- [Bounties](bounties.md)
- [Bounty 0: 100,000 sats Claimed!](bounty/0.md)
- [Bounty 1: 200,000 sats Claimed!](bounty/1.md)
Expand Down
32 changes: 32 additions & 0 deletions docs/src/guides/reindexing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Reindexing
==========

Sometimes the `ord` database must be reindexed, which means deleting the
database and restarting the indexing process with either `ord index run` or
`ord server`. Reasons to reindex are:

1. A new major release of ord, which changes the database scheme
2. The database got corrupted somehow

The database `ord` uses is called [redb](https://github.com/cberner/redb),
so we give the index the default file name `index.redb`. By default we store this
file in different locations depending on your operating system.

|Platform | Value | Example |
| ------- | ------------------------------------------------ | -------------------------------------------- |
| Linux | `$XDG_DATA_HOME`/ord or `$HOME`/.local/share/ord | /home/alice/.local/share/ord |
| macOS | `$HOME`/Library/Application Support/ord | /Users/Alice/Library/Application Support/ord |
| Windows | `{FOLDERID_RoamingAppData}`\ord | C:\Users\Alice\AppData\Roaming\ord |

So to delete the database and reindex on MacOS you would have to run the following
commands in the terminal:

```bash
rm ~/Library/Application Support/ord/index.redb
ord index run
```

You can of course also set the location of the data directory yourself with `ord
--data-dir <DIR> index run` or give it a specific filename and path with `ord
--index <FILENAME> index run`.