# All shards unassigned after migrating to 5.x (5.1.2)

**URL:** <https://discuss.elastic.co/t/all-shards-unassigned-after-migrating-to-5-x-5-1-2/73375>\
**Category:** Elasticsearch\
**Created:** [January 31, 2017, 2:00pm UTC](https://discuss.elastic.co/t/all-shards-unassigned-after-migrating-to-5-x-5-1-2/73375 "2017-01-31T14:00:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nixmind](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@nixmind](https://discuss.elastic.co/u/nixmind)\
**Post date:** [January 31, 2017, 2:00pm UTC](https://discuss.elastic.co/t/all-shards-unassigned-after-migrating-to-5-x-5-1-2/73375/1 "2017-01-31T14:00:30Z")

</div>

Hi,

I've migrated from elasticsearh **2.3.4** to **5.1.2** , and tried hard to get my cluster discovered

I have a cluster of three data nodes, and one client node in front of them making requests.

But since the update, I have all my shards UNASSIGNED (412 shards)/

I tried to reallocate them following the new guideline, but it's not working , I don't have any shard initialized.

The command I run from the client node is :

```auto
for shard in $(curl -XGET http://10.3.16.91:9200/_cat/shards | grep logstash-2016.12.09 | grep UNASSIGNED | awk '{print $2}'); do
    curl -XPOST 'http://10.3.16.91:9200/_cluster/reroute' -d '{
        "commands" : [ {
              "allocate_stale_primary" : {
                  "index" : "logstash-2016.12.09", 
                  "shard" : '"$shard"', 
                  "node" : "es-cluster.i-0db3ba0f4287fb527", 
                  "accept_data_loss" : truePreformatted text
              }
            }
        ]
    }'
    sleep 3
done 

And this is the kind of message I'm having in the screeenshot

<img src="//cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/elastic/original/2X/7/7ba6e7b4efb79e54fc7b88d353bd962789bcad0c.png" width="446" height="500">

Can you hep make my cluster up and running?
```

---

<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:** [February 28, 2017, 2:00pm UTC](https://discuss.elastic.co/t/all-shards-unassigned-after-migrating-to-5-x-5-1-2/73375/2 "2017-02-28T14:00:38Z")

</div>

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