Stop Fess and then install RPM/DEB package, see Installation in Installation Guide.

Fess 12 requires Elasticsearch 6.x, and indices for Fess 12 is not compatible with Fess 11.x. To upgrade to Elasticsearch 6, remove old indices and then upgrade Elasticsearch package. For Elasticsearch plugins, if you upgrade Elasticsearch, re-install all Elasticsearch plugins for the proper Elasticsearch version.