public static void Restore(RavenConfiguration configuration, string backupLocation, string databaseLocation) { using (var transactionalStorage = configuration.CreateTransactionalStorage(() => { })) { transactionalStorage.Restore(backupLocation, databaseLocation); } }
public DocumentDatabase(RavenConfiguration configuration) { Configuration = configuration; configuration.Container.SatisfyImportsOnce(this); workContext = new WorkContext { IndexUpdateTriggers = IndexUpdateTriggers }; TransactionalStorage = configuration.CreateTransactionalStorage(workContext.NotifyAboutWork); configuration.Container.SatisfyImportsOnce(TransactionalStorage); bool newDb; try { newDb = TransactionalStorage.Initialize(); } catch (Exception) { TransactionalStorage.Dispose(); throw; } IndexDefinitionStorage = new IndexDefinitionStorage( TransactionalStorage, configuration.DataDirectory, configuration.Container.GetExportedValues <AbstractViewGenerator>(), Extensions); IndexStorage = new IndexStorage(IndexDefinitionStorage, configuration); workContext.PerformanceCounters = new PerformanceCounters("Instance @ " + configuration.Port); workContext.IndexStorage = IndexStorage; workContext.TransactionaStorage = TransactionalStorage; workContext.IndexDefinitionStorage = IndexDefinitionStorage; InitializeTriggers(); ExecuteStartupTasks(); if (!newDb) { return; } OnNewlyCreatedDatabase(); }
public DocumentDatabase(RavenConfiguration configuration) { Configuration = configuration; configuration.Container.SatisfyImportsOnce(this); workContext = new WorkContext { IndexUpdateTriggers = IndexUpdateTriggers, ReadTriggers = ReadTriggers }; TransactionalStorage = configuration.CreateTransactionalStorage(workContext.NotifyAboutWork); configuration.Container.SatisfyImportsOnce(TransactionalStorage); bool newDb; try { newDb = TransactionalStorage.Initialize(); } catch (Exception) { TransactionalStorage.Dispose(); throw; } IndexDefinitionStorage = new IndexDefinitionStorage( TransactionalStorage, configuration.DataDirectory, configuration.Container.GetExportedValues<AbstractViewGenerator>(), Extensions); IndexStorage = new IndexStorage(IndexDefinitionStorage, configuration); workContext.PerformanceCounters = new PerformanceCounters("Instance @ " + configuration.Port); workContext.IndexStorage = IndexStorage; workContext.TransactionaStorage = TransactionalStorage; workContext.IndexDefinitionStorage = IndexDefinitionStorage; InitializeTriggers(); ExecuteStartupTasks(); if (!newDb) return; OnNewlyCreatedDatabase(); }
public static void Restore(RavenConfiguration configuration, string backupLocation, string databaseLocation) { using(var transactionalStorage = configuration.CreateTransactionalStorage(() => { })) { transactionalStorage.Restore(backupLocation, databaseLocation); } }