public Path backup()
    {
        final String postfix = "." + new Date().getTime();
        final Path original = configuration.getFile().toPath();
        final Path backup = configuration.getBackupDirectory().toPath().resolve( original.getFileName() + postfix );

        Log.info( "Creating a backup of {} in {}.", original, backup );
        try
        {
            Files.copy( original, backup );
            return backup;
        }
        catch ( IOException e )
        {
            Log.error( "An error occurred creating a backup of {} in {}!", original, backup, e );
        }
        return null;
    }
Copies the file that is the persistent storage for this store to a new file in the backup location.

@return The path in which the backup was created, or null if the creation of the backup failed.
xmppserver/src/main/java/org/jivesoftware/openfire/keystore/CertificateStore.java