# How to assign unassigned shards

**URL:** <https://discuss.elastic.co/t/how-to-assign-unassigned-shards/6042>\
**Category:** Elasticsearch\
**Created:** [December 1, 2011, 4:20pm UTC](https://discuss.elastic.co/t/how-to-assign-unassigned-shards/6042 "2011-12-01T16:20:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eran\_Kutner\_2](https://avatars.discourse-cdn.com/v4/letter/e/dc4da7/32.png) [@Eran\_Kutner\_2](https://discuss.elastic.co/u/Eran_Kutner_2)\
**Post date:** [December 1, 2011, 4:20pm UTC](https://discuss.elastic.co/t/how-to-assign-unassigned-shards/6042/1 "2011-12-01T16:20:40Z")

</div>

Hi,  
I'm trying to copy indexes from an old ES cluster running 0.16.4 to a new  
one running 0.18.5.  
The old cluster was using the FS gateway and the new one is using the local  
GW. So I copied the indices directory from the old FS GW under the new  
/nodes/0/ directory and the old metadata content under the new \_state  
I expected this to work and the server does indeed see all the indices but  
all the shards are listed as unassigned and the metadata file which was  
metadata-268 on the old cluster revered to metadata-2 after I started the  
server.

Is there a way to explicitly assign those shards to a master server?

Thanks,  
Eran

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 1, 2011, 4:23pm UTC](https://discuss.elastic.co/t/how-to-assign-unassigned-shards/6042/2 "2011-12-01T16:23:50Z")

</div>

This does not work, if you want to switch gateway implementations, you need  
to reindex.

On Thu, Dec 1, 2011 at 6:20 PM, Eran Kutner [eran@gigya-inc.com](mailto:eran@gigya-inc.com) wrote:

> Hi,  
> I'm trying to copy indexes from an old ES cluster running 0.16.4 to a new  
> one running 0.18.5.  
> The old cluster was using the FS gateway and the new one is using the  
> local GW. So I copied the indices directory from the old FS GW under the  
> new /nodes/0/ directory and the old metadata content under the new \_state  
> I expected this to work and the server does indeed see all the indices but  
> all the shards are listed as unassigned and the metadata file which was  
> metadata-268 on the old cluster revered to metadata-2 after I started the  
> server.
> 
> Is there a way to explicitly assign those shards to a master server?
> 
> Thanks,  
> Eran

---

<div class="post-metadata">

**Author:** ![Michael\_Sick](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Michael\_Sick](https://discuss.elastic.co/u/Michael_Sick)\
**Post date:** [December 1, 2011, 4:40pm UTC](https://discuss.elastic.co/t/how-to-assign-unassigned-shards/6042/3 "2011-12-01T16:40:42Z")

</div>

Shay,

Will it work even with the same Gateway? Just curious if this survives  
upgrades in ES/Lucene.

--Mike

On Thu, Dec 1, 2011 at 11:23 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> This does not work, if you want to switch gateway implementations, you  
> need to reindex.
> 
> On Thu, Dec 1, 2011 at 6:20 PM, Eran Kutner [eran@gigya-inc.com](mailto:eran@gigya-inc.com) wrote:
> 
> > Hi,  
> > I'm trying to copy indexes from an old ES cluster running 0.16.4 to a new  
> > one running 0.18.5.  
> > The old cluster was using the FS gateway and the new one is using the  
> > local GW. So I copied the indices directory from the old FS GW under the  
> > new /nodes/0/ directory and the old metadata content under the new \_state  
> > I expected this to work and the server does indeed see all the indices  
> > but all the shards are listed as unassigned and the metadata file which was  
> > metadata-268 on the old cluster revered to metadata-2 after I started the  
> > server.
> > 
> > Is there a way to explicitly assign those shards to a master server?
> > 
> > Thanks,  
> > Eran

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 1, 2011, 4:57pm UTC](https://discuss.elastic.co/t/how-to-assign-unassigned-shards/6042/4 "2011-12-01T16:57:28Z")

</div>

Yes, using the same gateway allows for upgrade without reindexing (I think  
thats what you mean).

On Thu, Dec 1, 2011 at 6:40 PM, Michael Sick \<  
[michael.sick@serenesoftware.com](mailto:michael.sick@serenesoftware.com)\> wrote:

> Shay,
> 
> Will it work even with the same Gateway? Just curious if this survives  
> upgrades in ES/Lucene.
> 
> --Mike
> 
> On Thu, Dec 1, 2011 at 11:23 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > This does not work, if you want to switch gateway implementations, you  
> > need to reindex.
> > 
> > On Thu, Dec 1, 2011 at 6:20 PM, Eran Kutner [eran@gigya-inc.com](mailto:eran@gigya-inc.com) wrote:
> > 
> > > Hi,  
> > > I'm trying to copy indexes from an old ES cluster running 0.16.4 to a  
> > > new one running 0.18.5.  
> > > The old cluster was using the FS gateway and the new one is using the  
> > > local GW. So I copied the indices directory from the old FS GW under the  
> > > new /nodes/0/ directory and the old metadata content under the new \_state  
> > > I expected this to work and the server does indeed see all the indices  
> > > but all the shards are listed as unassigned and the metadata file which was  
> > > metadata-268 on the old cluster revered to metadata-2 after I started the  
> > > server.
> > > 
> > > Is there a way to explicitly assign those shards to a master server?
> > > 
> > > Thanks,  
> > > Eran

---

<div class="post-metadata">

**Author:** ![Michael\_Sick](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@Michael\_Sick](https://discuss.elastic.co/u/Michael_Sick)\
**Post date:** [December 1, 2011, 5:02pm UTC](https://discuss.elastic.co/t/how-to-assign-unassigned-shards/6042/5 "2011-12-01T17:02:07Z")

</div>

It is, I didn't know if the formats changed over time such that either  
Lucene or ES would not understand the old index/format.

On Thu, Dec 1, 2011 at 11:57 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Yes, using the same gateway allows for upgrade without reindexing (I think  
> thats what you mean).
> 
> On Thu, Dec 1, 2011 at 6:40 PM, Michael Sick \<  
> [michael.sick@serenesoftware.com](mailto:michael.sick@serenesoftware.com)\> wrote:
> 
> > Shay,
> > 
> > Will it work even with the same Gateway? Just curious if this survives  
> > upgrades in ES/Lucene.
> > 
> > --Mike
> > 
> > On Thu, Dec 1, 2011 at 11:23 AM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > 
> > > This does not work, if you want to switch gateway implementations, you  
> > > need to reindex.
> > > 
> > > On Thu, Dec 1, 2011 at 6:20 PM, Eran Kutner [eran@gigya-inc.com](mailto:eran@gigya-inc.com) wrote:
> > > 
> > > > Hi,  
> > > > I'm trying to copy indexes from an old ES cluster running 0.16.4 to a  
> > > > new one running 0.18.5.  
> > > > The old cluster was using the FS gateway and the new one is using the  
> > > > local GW. So I copied the indices directory from the old FS GW under the  
> > > > new /nodes/0/ directory and the old metadata content under the new \_state  
> > > > I expected this to work and the server does indeed see all the indices  
> > > > but all the shards are listed as unassigned and the metadata file which was  
> > > > metadata-268 on the old cluster revered to metadata-2 after I started the  
> > > > server.
> > > > 
> > > > Is there a way to explicitly assign those shards to a master server?
> > > > 
> > > > Thanks,  
> > > > Eran

---

<div class="post-metadata">

**Author:** ![Eran\_Kutner\_2](https://avatars.discourse-cdn.com/v4/letter/e/dc4da7/32.png) [@Eran\_Kutner\_2](https://discuss.elastic.co/u/Eran_Kutner_2)\
**Post date:** [December 1, 2011, 6:45pm UTC](https://discuss.elastic.co/t/how-to-assign-unassigned-shards/6042/6 "2011-12-01T18:45:04Z")

</div>

Thanks Shay. Using the FS gateway worked.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 1, 2011, 8:05pm UTC](https://discuss.elastic.co/t/how-to-assign-unassigned-shards/6042/7 "2011-12-01T20:05:02Z")

</div>

cool, but, when you can, I highly recommend moving to the local gateway 🙂

On Thu, Dec 1, 2011 at 8:45 PM, Eran Kutner [eran@gigya-inc.com](mailto:eran@gigya-inc.com) wrote:

> Thanks Shay. Using the FS gateway worked.

---

<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 6, 2017, 3:46am UTC](https://discuss.elastic.co/t/how-to-assign-unassigned-shards/6042/8 "2017-07-06T03:46:40Z")

</div>


