private void restoreDescriptor(TreeMap<String, String> foreignKeys, List<String> messages, List<String> errorMessages) {
    ArtifactEntity backupEntity = artifactDAO.findByNameAndForeignKeys(KERBEROS_DESCRIPTOR_BACKUP_NAME, foreignKeys);

    if (backupEntity != null) {
      ArtifactEntity entity = artifactDAO.findByNameAndForeignKeys(KERBEROS_DESCRIPTOR_NAME, foreignKeys);
      if (entity != null) {
        artifactDAO.remove(entity);
      }

      entity = new ArtifactEntity();
      entity.setArtifactName(KERBEROS_DESCRIPTOR_NAME);
      entity.setForeignKeys(backupEntity.getForeignKeys());
      entity.setArtifactData(backupEntity.getArtifactData());

      artifactDAO.create(entity);
      logMessage(messages, "Restored kerberos descriptor from backup");
    } else {
      logErrorMessage(messages, errorMessages, "No backup of kerberos descriptor found");
    }
  }
Restores user defined kerberos descriptor from artifact with name {@code kerberos_descriptor_backup}.

@param foreignKeys   keys specific for cluster
@param messages      list of log messages
@param errorMessages list of error log messages
ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/UpgradeUserKerberosDescriptor.java