wiki:elasticsearch_commands
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
wiki:elasticsearch_commands [2022/12/09 08:59] – [Restore snapshot] add info about snapshot missing antisa | wiki:elasticsearch_commands [2023/01/11 16:03] (current) – [Restore snapshot] add restore single index antisa | ||
---|---|---|---|
Line 12: | Line 12: | ||
Replace " | Replace " | ||
+ | ==== Delete all indices ==== | ||
+ | |||
+ | curl -X DELETE ' | ||
===== Create snapshot ===== | ===== Create snapshot ===== | ||
Register repo first: | Register repo first: | ||
Line 30: | Line 33: | ||
curl -X PUT " | curl -X PUT " | ||
+ | |||
+ | <WRAP center round tip 60%> | ||
+ | To create single index snapshot use | ||
+ | < | ||
+ | curl -X PUT " | ||
+ | { | ||
+ | " | ||
+ | }' | ||
+ | </ | ||
+ | </ | ||
The backup folder is created in /// | The backup folder is created in /// | ||
Line 47: | Line 60: | ||
When you transfer it to another server unzip it, make sure that the owner is elasticsearch on the folder and then create the snapshot repository with command above, otherwise you won't see it when trying to list the snaphots. | When you transfer it to another server unzip it, make sure that the owner is elasticsearch on the folder and then create the snapshot repository with command above, otherwise you won't see it when trying to list the snaphots. | ||
- | List the snapshots with above command. If you get an error like: | + | List the snapshots with above command. |
- | + | ||
- | " | + | |
- | + | ||
- | Delete the snapshot repo | + | |
- | + | ||
- | curl -X DELETE -u undefined: | + | |
- | + | ||
- | and try listing again. | + | |
After this do the restore with snapshot name you want: | After this do the restore with snapshot name you want: | ||
curl -s -X POST " | curl -s -X POST " | ||
+ | |||
+ | <WRAP center round tip 60%> | ||
+ | To restore single index use | ||
+ | < | ||
+ | curl -s -X POST " | ||
+ | { | ||
+ | " | ||
+ | }' | ||
+ | </ | ||
+ | </ | ||
If you get an [[https:// | If you get an [[https:// | ||
- | curl -s -X POST " | + | curl -s -X POST " |
- | { | + | |
" | " | ||
- | } | + | }' |
==== Tested on ==== | ==== Tested on ==== | ||
Line 76: | Line 91: | ||
====== References ====== | ====== References ====== | ||
* https:// | * https:// | ||
+ | * https:// | ||
+ | |||
wiki/elasticsearch_commands.1670576360.txt.gz · Last modified: 2022/12/09 08:59 by antisa