/** * Restore the database from a backup * * IMPORTANT: if options.share_table_files == true and you restore the DB * from some backup that is not the latest, and you start creating new * backups from the new DB, they will probably fail! * * Example: Let's say you have backups 1, 2, 3, 4, 5 and you restore 3. * If you add new data to the DB and try creating a new backup now, the * database will diverge from backups 4 and 5 and the new backup will fail. * If you want to create new backup, you will first have to delete backups 4 * and 5. * * @param backupId The id of the backup to restore * @param dbDir The directory to restore the backup to, i.e. where your * database is * @param walDir The location of the log files for your database, * often the same as dbDir * @param restoreOptions Options for controlling the restore * * @throws RocksDBException thrown if the database could not be restored */ public void restoreDbFromBackup( final int backupId, final String dbDir, final String walDir, final RestoreOptions restoreOptions) throws RocksDBException { assert (isOwningHandle()); restoreDbFromBackup(nativeHandle_, backupId, dbDir, walDir, restoreOptions.nativeHandle_); }