GraphDatabaseService genericDb = DatabaseLocator.getGraphDatabase();
if ( genericDb instanceof EmbeddedGraphDatabase )
{
Backup backup = Neo4jBackup.allDataSources(
(EmbeddedGraphDatabase) genericDb,
backupPath.getAbsolutePath() );
backup.doBackup();
}
else
{
throw new UnsupportedOperationException(
"Performing backups on non-local databases is currently not supported." );