# Elasticsearch backup and restore results in index being in 'red' state. ES version: 6.8.23

**URL:** <https://discuss.elastic.co/t/elasticsearch-backup-and-restore-results-in-index-being-in-red-state-es-version-6-8-23/318172>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [November 4, 2022, 8:34am UTC](https://discuss.elastic.co/t/elasticsearch-backup-and-restore-results-in-index-being-in-red-state-es-version-6-8-23/318172 "2022-11-04T08:34:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iZAK328](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/izak328/32/115054_2.png) [@iZAK328](https://discuss.elastic.co/u/iZAK328)\
**Post date:** [November 4, 2022, 8:34am UTC](https://discuss.elastic.co/t/elasticsearch-backup-and-restore-results-in-index-being-in-red-state-es-version-6-8-23/318172/1 "2022-11-04T08:34:23Z")

</div>

Hi,  
I had tried to perform a backup of elasticsearch on a server and restore on a different server by copying the backup folder and the steps are mentioned as below.

**Index name** : the\_hive\_15  
**Source OS** : Ubuntu 18.04 - Elasticsearch version: 6.8.4  
**Destination OS** : Redhat 8.6 - Elasticsearch version: 6.8.23  
**Elasticsearch data size** : 21GB

> ERROR  
> Index is in **RED** state and cannot be read by the application using Elasticsearch.  
> _All shards failed_

### Steps

### 1. Creating backup repository

```auto
    path.repo: ["/opt/hivebackup"]

```

### 2. Change the owner of the repo

```auto
sudo chown -R elasticsearch:elasticsearch /opt/backup

```

### 3. Registering the snapshot repository

```auto
    curl -XPUT 'http://localhost:9200/_snapshot/the_hive_backup' -H 'Content-Type: application/json' -d '{
        "type": "fs",
        "settings": {
            "location": "/opt/backup",
            "compress": true,
        }
    }'

```

- **_RESPONSE_**

```auto
  {"acknowledged":true}

```

### 4. Backing up the data

```auto
    curl -XPUT 'http://localhost:9200/_snapshot/the_hive_backup/snapshot_1?wait_for_completion=true&pretty' -H 'Content-Type: application/json' -d '{
    "indices": "the_hive_15"
    }'

```

### 5. Registering the snapshot repository on the destination server

```auto
    curl -XPUT 'http://localhost:9200/_snapshot/the_hive_backup?pretty' -H 'Content-Type: application/json' -d '{
        "type": "fs",
        "settings": {
            "location": "/custom_location/hivebackup",
            "compress": true,
        }
    }'

```

- **_RESPONSE_**

```auto
{"acknowledged":true}

```

### 7. Restoring the data on the destination server

```auto
    curl -XPOST "http://localhost:9200/_snapshot/the_hive_backup/snapshot_1/_restore?pretty" -H 'Content-Type: application/json' -d '
    {
      "indices": "the_hive_15"
    }'

```

- **_RESPONSE_**

```auto
    {
        "acknowledged" : true
    }

```

On running the command `curl -XGET "localhost:9200/_cat/indices?v"`, I get the health status of the index as 'red'.  
 ![Elasticsearcherror](https://us1.discourse-cdn.com/elastic/optimized/3X/f/8/f8acd39e5f65ab0d2d7841ed8dc444a9bcfa6407_2_690x29.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 2, 2022, 8:34am UTC](https://discuss.elastic.co/t/elasticsearch-backup-and-restore-results-in-index-being-in-red-state-es-version-6-8-23/318172/2 "2022-12-02T08:34:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
