How to backup a Solr database?
Asked Answered
S

3

10

I wonder how to backup (dump) a Solr database?

If it is only to copy some files, then please specify which files (filename, location etc).

Thanks

Saturable answered 17/8, 2010 at 19:5 Comment(0)
R
6

Typically, the index is stored in $SOLR_HOME/data.

Back up that entire folder.

Romanesque answered 20/8, 2010 at 15:19 Comment(1)
If an IndexWriter is open while copying that directory, the backup will be corrupted.Gavrielle
M
12

We use Solr Replication to do our backup.

You can either have a slave that is dedicated to be a backup or use the "backup" command to make a backup on the master (I never used that last method).

Morelos answered 17/8, 2010 at 19:14 Comment(1)
This is the right answer, but I'm amazed how many people are still convinced they need to start/stop Solr or pause their indexing jobs.Contactor
R
6

Typically, the index is stored in $SOLR_HOME/data.

Back up that entire folder.

Romanesque answered 20/8, 2010 at 15:19 Comment(1)
If an IndexWriter is open while copying that directory, the backup will be corrupted.Gavrielle
L
0

In Solr 8/9 version solr backup and restore is available via its replication handler.

It will create a snapshot of the data which you can also restore later.

Here in the solr documentation page you can find more useful information:

https://solr.apache.org/guide/8_9/making-and-restoring-backups.html#standalone-mode-backups

So this can be used with new 8/9 version if someone is looking for it.

Luca answered 17/1, 2023 at 10:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.