Backing up and restoring an index
The Ingest service automatically retains backups of the most recent indexes. You can change the number of backups that are retained, and you can easily switch to a backup index for your Search services to use.
Prerequisites
Ensure you have enough storage space to hold all the indexes you intend to keep. Insufficient storage capacity in Elasticsearch can result in a site outage.
Index backups
When you build an index, by default backup copies are kept of the previous two builds. This setting does not affect performance, although, in certain circumstances you may notice apparent inconsistencies in your logs. For example, if you run several Store 1, Store 11 or eSite index rebuilds in a quick succession, you would expect to see only one index present with the latest timestamp. Because backups are kept, however, in such a case you may observe two indexes present that have the same timestamp. This merely indicates that backups are being created and that the most recent backup has been given the same timestamp as the current live index.
https://Data-Query:Port/search/resources/api/v2/configuration?nodeName=ingest&envType=auth
Search
for the alias.keep.backup parameter. Its default setting is
2
.Body:
{
"global": {
"connector": [
{
"name": "attribute",
"property": [
{ "name": "alias.keep.backup", "value": "0" }
]
}
]
}
}
For this example, the result is that no backup indexes are created. You
can adjust the number of backups as appropriate to your environment.Switching to a backup index
time.id
. For example, the product index name
can be .auth.11.product.202405142058
. To reveal all revisions from
the available indexes in Elasticsearch, use the following Elasticsearch
API:/_cat/indices?v&s=index
For more information about this endpoint, refer to cat indices API in the Elasticsearch documentation.
time.id
that you want to swtich to, use
the following Ingest API to perform the index alias switching:POST /connectors/envType.alias/run?storeId=storeId&timeId=timeId
where- envType
- Either
"auth"
or"live"
. - storeId
- The owning store identifier.
- timeId
- The twelve-digit time identifier.