# Can't restore snapshot in Elasticsearch-2.3.3

**URL:** <https://discuss.elastic.co/t/cant-restore-snapshot-in-elasticsearch-2-3-3/54223>\
**Category:** Elasticsearch\
**Created:** [June 29, 2016, 3:09am UTC](https://discuss.elastic.co/t/cant-restore-snapshot-in-elasticsearch-2-3-3/54223 "2016-06-29T03:09:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suzuki\_Keita](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suzuki_keita/32/10954_2.png) [@Suzuki\_Keita](https://discuss.elastic.co/u/Suzuki_Keita)\
**Post date:** [June 29, 2016, 3:09am UTC](https://discuss.elastic.co/t/cant-restore-snapshot-in-elasticsearch-2-3-3/54223/1 "2016-06-29T03:09:07Z")

</div>

I want to upgrade to 2.3.3 from 1.5.1.  
So I got 1.5.1 snapshot and I want to restore the 1.5.1 snapshot in 2.3.3.  
By the way, 2.3.3 is newly built.

However, the following error occurred.  
Because maybe `snap-posts_v3_20160628.dat` not found.

```auto
{
  "error" : {
    "root_cause" : [ {
      "type" : "snapshot_missing_exception",
      "reason" : "[snapshot1:posts_v3_20160628] is missing"
    } ],
    "type" : "snapshot_missing_exception",
    "reason" : "[snapshot1:posts_v3_20160628] is missing",
    "caused_by" : {
      "type" : "no_such_file_exception",
      "reason" : "/var/elasticsearch/snapshot/snapshot1/snap-posts_v3_20160628.dat"
    }
  },
  "status" : 404
}

```

Getting snapshot in 1.5.1, `*.dat` file is not created.

```auto
drwxr-xr-x 3 elasticsearch elasticsearch 4096 6月 29 02:30 .
drwxr-xr-x 4 elasticsearch elasticsearch 4096 6月 29 01:46 ..
-rw-r--r-- 1 elasticsearch elasticsearch 58 6月 28 08:31 index
drwxr-xr-x 4 elasticsearch elasticsearch 4096 6月 28 08:31 indices
-rw-r--r-- 1 elasticsearch elasticsearch 61 6月 28 08:30 metadata-posts_v3_20160628
-rw-r--r-- 1 elasticsearch elasticsearch 188 6月 28 08:30 snapshot-posts_v3_20160628

```

How do I restore the 1.5.1 of the data ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 29, 2016, 4:25am UTC](https://discuss.elastic.co/t/cant-restore-snapshot-in-elasticsearch-2-3-3/54223/2 "2016-06-29T04:25:24Z")

</div>

Here is my opinion.

First upgrade all machines to the latest 1.7 version. You can do a rolling upgrade.  
Then install the migration plugin. It will tell you if you can directly upgrade to 2.x or not.

Depending on the result, you might have to run the upgrade API then snapshot.

Then you could restore in the 2.3 instances.

My 2 cents

---

<div class="post-metadata">

**Author:** ![Suzuki\_Keita](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suzuki_keita/32/10954_2.png) [@Suzuki\_Keita](https://discuss.elastic.co/u/Suzuki_Keita)\
**Post date:** [June 29, 2016, 4:44pm UTC](https://discuss.elastic.co/t/cant-restore-snapshot-in-elasticsearch-2-3-3/54223/3 "2016-06-29T16:44:34Z")

</div>

Thanks. But it failed.  
By 1.7 getting snapshot, \*.dat file is not created and failed to restore to 2.3.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 29, 2016, 5:01pm UTC](https://discuss.elastic.co/t/cant-restore-snapshot-in-elasticsearch-2-3-3/54223/4 "2016-06-29T17:01:25Z")

</div>

Can you describe all the exact steps you did so far?

---

<div class="post-metadata">

**Author:** ![Suzuki\_Keita](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suzuki_keita/32/10954_2.png) [@Suzuki\_Keita](https://discuss.elastic.co/u/Suzuki_Keita)\
**Post date:** [June 29, 2016, 5:28pm UTC](https://discuss.elastic.co/t/cant-restore-snapshot-in-elasticsearch-2-3-3/54223/5 "2016-06-29T17:28:52Z")

</div>

Yes.  
Raise the version from 1.5 to 1.7 in the First.

```auto
$ sudo rpm -ivh --replacefiles https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.0.noarch.rpm
$ sudo mv /etc/elasticsearch/elasticsearch.yml /etc/elasticsearch/elasticsearch.yml_1.5.1
$ sudo mv /etc/elasticsearch/elasticsearch.yml.rpmsave /etc/elasticsearch/elasticsearch.yml
$ sudo survice elasticsearch start
$ curl localhost:9200
{
  "status" : 200,
  "name" : "Caleb Alexander",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.7.0",
    "build_hash" : "929b9739cae115e73c346cb5f9a6f24ba735a743",
    "build_timestamp" : "2015-07-16T14:31:07Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.4"
  },
  "tagline" : "You Know, for Search"
}

```

Next take a snapshot

```auto
$ sudo mkdir -p /var/elasticsearch/snapshot
$ sudo chown -R elasticsearch:elasticsearch /var/elasticsearch

...

Append the following to elasticsearch.yml
path.repo: ["/var/elasticsearch/snapshot"]

...

$ sudo service elasticsearch restart
$ curl -XPUT 'http://localhost:9200/_snapshot/snapshot1' -d '
{
  "type": "fs",
  "settings": {
    "location": "/var/elasticsearch/snapshot/snapshot1",
    "compress": true
  }
}
'
$ curl -XPUT localhost:9200/_snapshot/snapshot1/posts_v2_20160622?wait_for_completion=true -d '
{
  "indices": "posts_v2",
  "ignore_unavailable": "true",
  "include_global_state": false
}
'
$ exit

```

Copy snapshot directory to `/tmp` in 2.3.3 server, And then restore to 2.3.3

```auto
$ sudo mkdir -p /var/elasticsearch/snapshot
$ mv /tmp/snapshot1 /var/elasticsearch/snapshot/snapshot1
$ sudo chown -R elasticsearch:elasticsearch /var/elasticsearch

...

Append the following to elasticsearch.yml
path.repo: ["/var/elasticsearch/snapshot"]

...

$ sudo service elasticsearch restart
$ curl -XPUT 'http://localhost:9200/_snapshot/snapshot1' -d '
{
  "type": "fs",
  "settings": {
    "location": "/var/elasticsearch/snapshot/snapshot1",
    "compress": true
  }
}
'
$ curl -XPOST localhost:9200/_snapshot/snapshot1/posts_v2_20160622/_restore?pretty -d '
{
  "indices": "posts_v2",
  "ignore_unavailable": "true",
  "include_global_state": false,
  "rename_pattern": "posts_v2",
  "rename_replacement": "posts_v3"
}
'
{
  "error" : {
    "root_cause" : [ {
      "type" : "snapshot_missing_exception",
      "reason" : "[snapshot1:posts_v2_20160622] is missing"
    } ],
    "type" : "snapshot_missing_exception",
    "reason" : "[snapshot1:posts_v2_20160622] is missing",
    }
  },
"status" : 404
}

```

Upgrading to 1.7, no\_such\_file\_exception didn't show but it failed restore.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 29, 2016, 6:26pm UTC](https://discuss.elastic.co/t/cant-restore-snapshot-in-elasticsearch-2-3-3/54223/6 "2016-06-29T18:26:01Z")

</div>

Thanks for the detailed report. I'm pinging @Igor_Motov about it in case I missed something obvious.

I wonder why you installed 1.7.0 instead of 1.7.5?

---

<div class="post-metadata">

**Author:** ![Suzuki\_Keita](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/suzuki_keita/32/10954_2.png) [@Suzuki\_Keita](https://discuss.elastic.co/u/Suzuki_Keita)\
**Post date:** [June 30, 2016, 6:31am UTC](https://discuss.elastic.co/t/cant-restore-snapshot-in-elasticsearch-2-3-3/54223/7 "2016-06-30T06:31:36Z")

</div>

@dadoonet  
Thank you for the important tips !  
Then I tried to restore from 1.7.5 to 2.2.3 .  
And it was successful .

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 30, 2016, 7:24am UTC](https://discuss.elastic.co/t/cant-restore-snapshot-in-elasticsearch-2-3-3/54223/8 "2016-06-30T07:24:41Z")

</div>

Great! Thanks for confirming.

---

<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:** [July 5, 2017, 10:39pm UTC](https://discuss.elastic.co/t/cant-restore-snapshot-in-elasticsearch-2-3-3/54223/9 "2017-07-05T22:39:16Z")

</div>


