# Restore snapshots on a different environment

**URL:** <https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325>\
**Category:** Elasticsearch\
**Created:** [March 27, 2020, 3:24am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325 "2020-03-27T03:24:14Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [March 27, 2020, 3:24am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/1 "2020-03-27T03:24:14Z")

</div>

Hey All,  
I want to take a snapshot and restore on a different environment.  
**What are the steps I should follow?**  
I already created the snapshots on the original environment.  
I have multiple files created on each node (I have several elastic nodes).

- I have indices directory created on each node.
- On the master node, I have other files and folders created.  
 ![2020-03-27 14_20_45-172.21.87.43 - Remote Desktop Connection](https://us1.discourse-cdn.com/elastic/original/3X/4/e/4e7bf0d9e11209e32718cc14a5cf1714c3aefbed.png)

What's next?  
Should I copy the files to the new environment? I am not sure what should be done next.  
What are the critical files? Or all of them are critical?

Thank you!

---

<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:** [March 27, 2020, 4:26am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/2 "2020-03-27T04:26:35Z")

</div>

If you used the snapshot API you just need to use the restore API. You don't need to manually do anything with files.

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [April 2, 2020, 1:28am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/3 "2020-04-02T01:28:08Z")

</div>

Hi @dadoonet  
Thanks for the reply.  
This is a completely different environment.  
So I cannot restore the snapshot as the new environment is not connected to the same repository or even the same network.

Thanks

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 2, 2020, 3:36am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/4 "2020-04-02T03:36:03Z")

</div>

Taking and restoring shapshots at the file system level is not supported and will not work in newer versions. You should use the snapshot api to create the snapshot into some shared storage mounted on all the nodes. This snapshot can then be transferred to a different environment, mounted onto all the nodes in that cluster and restored.

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [April 2, 2020, 4:35am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/5 "2020-04-02T04:35:59Z")

</div>

Hi @Christian_Dahlqvist  
Thanks for the reply.  
That is exactly what I am trying to do.

I am asking about the technical way to do so.  
Should I merge directories with same IDs?  
Simply copy and restore?  
Anything I need to know?

Thanks

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 2, 2020, 5:03am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/6 "2020-04-02T05:03:30Z")

</div>

You create the snapshot onto shared storage using the [snapshot API](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/snapshot-restore.html). Once it has completed you can transfer it as it is. Do not make any changes to it. Then mount it again as shared storage onto all nodes in the destination cluster, configure the repository and restore.

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [April 2, 2020, 5:52am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/7 "2020-04-02T05:52:15Z")

</div>

Hey @Christian_Dahlqvist  
One point is  
In the original environment I have 5 nodes, while in the destination I have 1 node.  
I have duplicate directories names across the nodes.  
One directory on node A has only dat file, while its duplicated directory on node B has also the indices folder and files.  
If I want to move it to another repository, I will have conflicts.

Thanks

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 2, 2020, 6:00am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/8 "2020-04-02T06:00:06Z")

</div>

It sounds like you are looking directly at the file system of the nodes and not creating a snapshot using the API I linked to. The API will handle this and take a cluster wide snapshot which can be restored to a cluster of different size without problems. Restoring based on direct file system snapshot the way you seem to describe is not supported and will not work.

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [April 2, 2020, 6:04am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/9 "2020-04-02T06:04:40Z")

</div>

Hi @Christian_Dahlqvist  
I am creating a snapshot with the API.  
It is created successfully and can be restored as well in the same environment.  
Restoring with API or via Kibana UI is working just fine.

I would like, however, to restore the snapshot on another cluster. In another network.

How can I do that? If at all?

Thank you

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 2, 2020, 6:07am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/10 "2020-04-02T06:07:10Z")

</div>

You need to move the full snapshot that you too to the new environment. If it is a single node cluster you can mount it directly but if you have several nodes you need to use shared storage. Then configure a repository that points to this location and use the restore API. You naturally need to set up the repo path in your config just as you did on the cluster where you created the snapshot.

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [April 2, 2020, 6:13am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/11 "2020-04-02T06:13:19Z")

</div>

Hey  
I have configured a repository on each node.  
Lets call it repo\_folder.  
So I have 5 X repo\_folder, 1 for each node. Not 1 shared storage.  
That means that I cannot just copy all repo\_folders into the new env as is.  
So, I guess it is a bad configuration to start with?!

How should I configure the repository is such a case? Or must I have a shared storage?

Thanks

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 2, 2020, 6:30am UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/12 "2020-04-02T06:30:21Z")

</div>

Yes, shared storage is required. The API should not work without it so I am not sure how you have managed to create a snapshot using it.

If you have internet access there is also a plugin that allows you to take snapshots to AWS S3, which could remove the need to move the snapshot around.

---

<div class="post-metadata">

**Author:** ![AClerk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aclerk/32/55297_2.png) [@AClerk](https://discuss.elastic.co/u/AClerk)\
**Post date:** [April 2, 2020, 10:09pm UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/13 "2020-04-02T22:09:11Z")

</div>

Hi @Christian_Dahlqvist  
Thanks for the explanations and your patients.  
I am not sure how it works, but the snapshot API works just fine with my settings.  
However, it creates a different issue as discussed in this thread.  
I will try to create a new repository on a shared storage.

Thank you again

---

<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:** [April 30, 2020, 10:09pm UTC](https://discuss.elastic.co/t/restore-snapshots-on-a-different-environment/225325/14 "2020-04-30T22:09:14Z")

</div>

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