# How to properly upgrade plugins when upgrading Elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-to-properly-upgrade-plugins-when-upgrading-elasticsearch/105772>\
**Category:** Elasticsearch\
**Created:** [October 30, 2017, 3:00pm UTC](https://discuss.elastic.co/t/how-to-properly-upgrade-plugins-when-upgrading-elasticsearch/105772 "2017-10-30T15:00:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Lecour](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremy_lecour/32/1416_2.png) [@Jeremy\_Lecour](https://discuss.elastic.co/u/Jeremy_Lecour)\
**Post date:** [October 30, 2017, 3:00pm UTC](https://discuss.elastic.co/t/how-to-properly-upgrade-plugins-when-upgrading-elasticsearch/105772/1 "2017-10-30T15:00:01Z")

</div>

Hi,

I've recently upgraded a single Elasticsearch node from 5.6.2 to 5.6.3 and it refused to start because the "analysis-phonetic" plugin also needed to be upgraded.

I maintain my system up-to-date with Debian repositories, so Elasticsearch is upgraded whenever I "apt upgrade". Since I manage many servers, I have a few scripts to help automate this.

There I' ve found out that I also need to be aware of mandatory plugin upgrades and I'm looking for a better automation.

I can easily make a script to automatically remove/install every already installed plugin, then restart Elasticsearch, but something more fine-grained would be better. Like restarting Elasticsearch only if a "blocking" plugin is upgraded.

Is there an already established "good practice" for this?

Thanks you

Here is a very basic shell script for a very naive upgrade workflow :

```
#!/bin/bash

set -e
set -u

PLUGIN_BIN=/usr/share/elasticsearch/bin/elasticsearch-plugin
NEED_RESTART=""

for plugin in $(${PLUGIN_BIN} list); do
    "${PLUGIN_BIN}" remove "${plugin}"
    "${PLUGIN_BIN}" install "${plugin}"
    NEED_RESTART="1"
done

if [-n "${NEED_RESTART}"]; then
    systemctl restart elasticsearch
fi

exit 0
```

---

<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:** [November 1, 2017, 6:16pm UTC](https://discuss.elastic.co/t/how-to-properly-upgrade-plugins-when-upgrading-elasticsearch/105772/2 "2017-11-01T18:16:50Z")

</div>

> I can easily make a script to automatically remove/install every already installed plugin, then restart Elasticsearch

I think that's the right thing to do indeed.  
It's somewhat is documented here: [Rolling upgrade | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/rolling-upgrades.html)

Are you looking for something else?

---

<div class="post-metadata">

**Author:** ![Jeremy\_Lecour](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jeremy_lecour/32/1416_2.png) [@Jeremy\_Lecour](https://discuss.elastic.co/u/Jeremy_Lecour)\
**Post date:** [November 3, 2017, 10:33am UTC](https://discuss.elastic.co/t/how-to-properly-upgrade-plugins-when-upgrading-elasticsearch/105772/3 "2017-11-03T10:33:25Z")

</div>

Thanks for the confirmation. I understand that there is nothing available to detect if plugins need to be upgraded or not, if they will block ES startup or not.

---

<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 1, 2017, 10:33am UTC](https://discuss.elastic.co/t/how-to-properly-upgrade-plugins-when-upgrading-elasticsearch/105772/4 "2017-12-01T10:33:46Z")

</div>

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