Rollback Ambari 7.1.x to Ambari 2.7.5

You must use the backup of Ambari 2.7.5 to perform the following steps.

In 7.1.x, x represents greater than or equal to 6. For example, 7.1.6, 7.1.7, and so on.
  1. Stop all services in Ambari UI.
  2. On the Ambari Server host, stop the Ambari Server.
    ambari-server stop
    Stop  Ambari Agent on all host
    ambari-agent stop
  3. Obtain Ambari Repositories:
    wget -nv${your_ambari_version}/centos7/ambari.repo -O 
    yum clean all
  4. Downgrade ambari-server, ambari-agent packages manually using “yum downgrade <packagename>”
    yum  downgrade ambari-server
    yum  downgrade ambari-agent # on all hosts
  5. Reinitialize Ambari DB - Drop the old schema and initialize blank new schema :
    Example - Postgres
    psql -W -d ${AMBARI_DB_NAME} --user ${AMBARI_DB_USER}
    CREATE SCHEMA ambari;
    GRANT ALL ON SCHEMA ambari TO ambari;
    mysql -u ${AMBARI_DB_USER} 
    drop database ${AMBARI_DB_NAME}; 
    create database ${AMBARI_DB_NAME};
  6. Populate the Ambari database with backup data:
    psql -W -d ${AMBARI_DB_NAME} --user ${AMBARI_DB_USER} < pre_upgrade.sql
    mysql -u ${AMBARI_DB_USER} ${AMBARI_DB_NAME} < pre_upgrade.sql
  7. Restore these files from the backup:
  8. Restore old stack symlinks on Agent nodes:
    hdp-select set all
  9. Check ambari-server user:
    grep ambari-server.user /etc/ambari-server/conf/
    If ambari-server is running as non-root user, set permissions for files by running:
    ambari-server setup
  10. Start Ambari