Follow the below steps to upgrade the Ambari server.
Stop Infra-solr Service
Stop the Infra-solr Service from Ambari-UI.

Stop Ambari Server and Agents
Stop Ambari Server
Take the backup of ambari-server configs.
/etc/ambari-serfver/conf/
ambari-server stopStop Agents
Stop Ambari-agent on every cluster nodes.
ambari-agent stopBack up Ambari Database
Take the Ambari-server backend database backup from the server host.
DB Backup Commands
mkdir /tmp/ambari-server_db_bckpmysqldump --databases ambari > /tmp/ambari-server_db_bckp/ambari_mysql_bckp.sqlThe upgraded version Ambari-2.7.8.2-2 supports only Python 2. Please ensure Python 2 is installed and configured on all cluster nodes before proceeding with the upgrade.
Verify the Python Version
python -VResponse: Python 2.7.x.
Add Ambari Repo on Cluster Nodes
Back up the Old Ambari Repository
mv /etc/yum.repos.d/ambari.repo /tmp/Retrieve the latest Ambari repository details from Accessing Acceldata Repositories and add it to all cluster nodes.
List the existing Ambari packages
On RHEL
rpm -qa | grep ambariOn Ubuntu
apt list ambari-*Example Output (if the current Ambari version is 2.7.6.0-1):
ambari-infra-solr-2.7.6.0-1.noarchambari-agent-2.7.6.0-1.x86_64ambari-server-2.7.6.0-1.x86_64ambari-infra-solr-client-2.7.6.0-1.noarchRemove the Existing Ambari Packages
From the Ambari Server node, remove the installed packages before upgrading:
On RHEL
yum remove ambari-serverOn Ubuntu
apt remove ambari-server- Adjust the package names based on the installed versions on each node.
- You can verify installed packages before removal using:
On RHEL
rpm -qa | grep ambariOn Ubuntu
apt list ambari-*Make sure the Amabri packages are not installed.
Install Ambari packages
Install the latest Ambari-server only on ambari-server node.
Server Node
For RHEL
yum clean allyum install ambari-server -yFor Ubuntu
apt clean apt update apt install ambari-server -yAmbari Server Configuration Files Restore
Restore the configuration files backed up at step4 (Backup Taken in step 4).
Restore ambari.properties File
cp conf_12_02_25_16_52.save/ambari.properties conf/When prompted, enter 'y' to confirm.
cp: overwrite 'conf/ambari.properties'? yRestore passwd.dat File
cp /etc/ambari-server/conf_12_02_25_16_52.save/password.dat /etc/ambari-server/conf/password.datAmbari Server Schema Upgrade
Before upgrading, ensure a database backup has been taken (as mentioned in Step 6).
Run the Ambari Server upgrade command:
ambari-server upgrade -vResponse when prompted:
Ambari Server configured for MySQL. Confirm you have made a backup of the Ambari Server database [y/n] (n)? yEnter 'y' to confirm.After the successful completion, you must see the following message.
Ambari Server 'upgrade' completed successfully.Start Ambari-server
ambari-server startOnce started, verify that the Ambari UI is accessible using the same URL as before.
###
Verify Ambari Version
Verify the upgraded Ambari version in admin->about on top right corner in Ambari UI.

The Ambari version is upgraded successfully.