문제

I read the Backup and Restore doc at RavenDB website and tried it in my code.

In the doc we have:

Initiating a backup

When running in embedded mode, all you need is to call the method DocumentDatabase.StartBackup().

The above line of code just won't compile with error:

An object reference is required for the non-static field, method, or property
'Raven.Database.DocumentDatabase.StartBackup(string, bool)'

So I tried this just to test:

new DocumentDatabase(_documentStore.Configuration).
                                               StartBackup(@"~\App_Data\Backup", true);

The code compiles but when the app starts I get this error:

Could not open transactional storage: C:\Project\trunk\MyApp\App_Data\Database\Data

Can someone please share some working code about how can one do a full backup of an online embedded document store? Is it even possible without using RavenDB server?

My only option is doing a manual backup of the database folder?

도움이 되었습니까?

해결책

Leniel, You need to use the StartBackup method on the actual instance that you are running. If you are using the EmbeddableDocumentStore, you need to do:

 embeddableDocumentStore.DocumentDatabase.StartBackup(...);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top