# Retaining Logstash Keystore Password Across Upgrades Without Repeated Commands

**URL:** <https://discuss.elastic.co/t/retaining-logstash-keystore-password-across-upgrades-without-repeated-commands/366392>\
**Category:** Logstash\
**Tags:** elastic-stack-alerting\
**Created:** [September 11, 2024, 8:34am UTC](https://discuss.elastic.co/t/retaining-logstash-keystore-password-across-upgrades-without-repeated-commands/366392 "2024-09-11T08:34:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Mathan\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_mathan_s/32/132861_2.png) [@Michael\_Mathan\_S](https://discuss.elastic.co/u/Michael_Mathan_S)\
**Post date:** [September 11, 2024, 8:34am UTC](https://discuss.elastic.co/t/retaining-logstash-keystore-password-across-upgrades-without-repeated-commands/366392/1 "2024-09-11T08:34:51Z")

</div>

Hi, my requirement is as follows:

I installed Logstash on my server, and I successfully ran the commands `logstash-keystore create` and `logstash-keystore add ES_PWD` to set the keystore password. After this, I backed up the `logstash-keystore.keystore` file. Then, I upgraded Logstash and removed the `logstash-keystore.keystore` file from the config path. I replaced it with the old `logstash-keystore.keystore` file in the config path and started Logstash. However, now I am facing an error in the Logstash log folder that says, "Unable to connect to Elasticsearch" and "Unable to authenticate."

My question is: How can I retain the keystore password while upgrading Logstash without having to run the `logstash-keystore create` and `logstash-keystore add ES_PWD` commands every time? Are there any possible approaches to avoid these steps?

Regards,  
Michael Mathan S
