code: public void backupConfiguration(String filename, String originalFilename) {
  
          // ensure backup folder exists
          File backupFolder = new File(m_configRfsPath + FOLDER_BACKUP);
          if (!backupFolder.exists()) {
              backupFolder.mkdirs();
          }
  
          // copy file to (or from) backup folder
          originalFilename = FOLDER_BACKUP + originalFilename;
          File file = new File(m_configRfsPath + originalFilename);
          if (file.exists()) {
              copyFile(originalFilename, filename);
          } else {
              copyFile(filename, originalFilename);
          }
      }
docs: Restores the opencms.xml either to or from a backup file, depending
  whether the setup wizard is executed the first time (the backup
  does not exist) or not (the backup exists).
  
  @param filename something like e.g. "opencms.xml"
  @param originalFilename the configurations real file name, e.g. "opencms.xml.ori"