Esempio n. 1
0
        public void Backup_and_restore_of_system_database_should_work()
        {
            using (var ravenServer = GetNewServer(requestedStorage: "esent", runInMemory: false))
                using (var _ = NewRemoteDocumentStore(ravenDbServer: ravenServer, databaseName: "fooDB", runInMemory: false, fiddler: true))
                {
                    var systemDatabaseBackupOperation = new BackupOperation
                    {
                        BackupPath = BackupDir,
                        Database   = Constants.SystemDatabase,
                        ServerUrl  = ravenServer.Server.Configuration.ServerUrl
                    };

                    Assert.True(systemDatabaseBackupOperation.InitBackup());
                    WaitForBackup(ravenServer.Server.SystemDatabase, true);
                }

            Assert.DoesNotThrow(() => DocumentDatabase.Restore(new RavenConfiguration(), BackupDir, DataDir, s => { }, defrag: false));
        }
Esempio n. 2
0
        public void Backup_and_restore_of_system_database_should_work()
        {
            using (var ravenServer = GetNewServer(runInMemory: false, requestedStorage: "esent"))
                using (var _ = NewRemoteDocumentStore(ravenDbServer: ravenServer, databaseName: "fooDB", runInMemory: false))
                {
                    using (var systemDatabaseBackupOperation = new BackupOperation
                    {
                        BackupPath = BackupDir,
                        Database = Constants.SystemDatabase,
                        ServerUrl = ravenServer.SystemDatabase.Configuration.ServerUrl
                    })
                    {
                        Assert.True(systemDatabaseBackupOperation.InitBackup());
                        WaitForBackup(ravenServer.SystemDatabase, true);
                    }
                }

            Assert.DoesNotThrow(() => MaintenanceActions.Restore(new RavenConfiguration(), new RestoreRequest
            {
                BackupLocation   = BackupDir,
                DatabaseLocation = DataDir
            }, s => { }));
        }