private void backupDescriptor(TreeMap<String, String> foreignKeys, List<String> messages, List<String> errorMessages) {
    ArtifactEntity backupEntity = artifactDAO.findByNameAndForeignKeys(KERBEROS_DESCRIPTOR_BACKUP_NAME, foreignKeys);
    if (backupEntity != null) {
      artifactDAO.remove(backupEntity);
    }

    ArtifactEntity entity = artifactDAO.findByNameAndForeignKeys(KERBEROS_DESCRIPTOR_NAME, foreignKeys);
    if (entity != null) {
      backupEntity = new ArtifactEntity();
      backupEntity.setArtifactName(KERBEROS_DESCRIPTOR_BACKUP_NAME);
      backupEntity.setForeignKeys(entity.getForeignKeys());
      backupEntity.setArtifactData(entity.getArtifactData());

      artifactDAO.create(backupEntity);
      logMessage(messages, "Created backup of kerberos descriptor");
    } else {
      logErrorMessage(
          messages,
          errorMessages,
          "No backup of kerberos descriptor created due to missing original kerberos descriptor"
      );
    }


  }
Create copy of user defined kerberos descriptor and stores it 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