code: protected String createIndexBackup() {
  
          if (!isBackupReindexing()) {
              // if no backup is generated we don't need to do anything
              return null;
          }
  
          // check if the target directory already exists
          File file = new File(getPath());
          if (!file.exists()) {
              // index does not exist yet, so we can't backup it
              return null;
          }
          String backupPath = getPath() + "_backup";
          FSDirectory oldDir = null;
          FSDirectory newDir = null;
          try {
              // open file directory for Lucene
              oldDir = FSDirectory.open(file.toPath());
              newDir = FSDirectory.open(Paths.get(backupPath));
              for (String fileName : oldDir.listAll()) {
                  newDir.copyFrom(oldDir, fileName, fileName, IOContext.DEFAULT);
              }
          } catch (Exception e) {
              LOG.error(
                  Messages.get().getBundle().key(Messages.LOG_IO_INDEX_BACKUP_CREATE_3, getName(), getPath(), backupPath),
                  e);
              backupPath = null;
          } finally {
              if (oldDir != null) {
                  try {
                      oldDir.close();
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
              if (newDir != null) {
                  try {
                      newDir.close();
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
          }
          return backupPath;
      }
docs: Creates a backup of this index for optimized re-indexing of the whole content.<p>
  
  @return the path to the backup folder, or <code>null</code> in case no backup was created