# Elasticsearch upgrade 5.x to 6.x



## enfield303 (Apr 19, 2018)

Hello all, I'm using Elasticsearch 5.x and have noticed 6.x is now in the ports tree; as these versions are both separate ports can anyone tell me how I would upgrade my 5.x installation to 6.x using portmaster?

Thanks.


----------



## SirDice (Apr 20, 2018)

It should be straightforward. Uninstall the old and install the new version.

https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-upgrade.html


----------



## enfield303 (Apr 20, 2018)

Thanks for getting back to me;

As Elasticsearch does support direct upgrades from 5.x to 6.x I'd rather not uninstall the product and reinstall - what would happen to my index data and config files if I did uninstall, would they remain in place?

If I did uninstall 5.x then installed 6.x, is it a simple matter of pointing it to the existing index data directory and it then just works?


----------



## SirDice (Apr 20, 2018)

When you uninstall a port (or package) modified configuration files (and databases) will be kept. New installations never overwrite existing configuration files. So it's safe to remove a package, it's not going to remove the data. 

But, as with all upgrades, there's always a certain risk involved so be sure to make backups.


----------

