Restore DB by command line on RavenDB running on Linux

99 views
Skip to first unread message

Vladimir Zlatkovski

unread,
Jan 4, 2018, 8:20:37 AM1/4/18
to RavenDB - 2nd generation document database
Hello,

I'm running RavenDB on Linux that is in docker container.

I want to write simple powershell script to restore database on the ravendb instance in that linux container.

I've tried to execute the restore command __inside__ the linux machine itself, but I didnt have any luck ( There were shell scripts only for starting the server ... ).

Since the ravendb is available from the linux machie on http://172.17.0.2:8080,  I've tried with locally installed ( on windows machine ) ravendb instance to run this command:  

.\Raven.Server.exe --restore-source="C:\Users\Vladimir\Desktop\data" --restore-database="http://172.17.0.2:8080"

This is the result:

A critical error occurred while starting the server. Please see the exception details bellow for more details:
Raven.Abstractions.Exceptions.BadRequestException: There is no handler for path: POST /admin/restore ---> Raven.Abstractions.Connection.ErrorResponseException: Status code: BadRequest


   --- End of inner exception stack trace ---
   at Raven.Client.Connection.Implementation.HttpJsonRequest.<CheckForErrorsAndReturnCachedResultIfAnyAsync>d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Raven.Client.Connection.Implementation.HttpJsonRequest.<>c__DisplayClass36_0.<<SendRequestInternal>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Raven.Client.Connection.Implementation.HttpJsonRequest.<RunWithAuthRetry>d__38`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Raven.Client.Connection.Async.AsyncAdminServerClient.<StartRestoreAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Raven.Abstractions.Util.AsyncHelpers.<>c__DisplayClass1_1`1.<<RunSync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Raven.Abstractions.Util.AsyncHelpers.RunSync[T](Func`1 task)
   at Raven.Server.Program.RunRemoteDatabaseRestoreOperation(String backupLocation, String restoreLocation, String restoreDatabaseName, Boolean defrag, Boolean disableReplicationDestionations, Uri uri, Boolean waitForRestore, Nullable`1 timeout)
   at Raven.Server.Program.<>c__DisplayClass6_1.<InteractiveRun>b__34()
   at Raven.Server.Program.InteractiveRun(String[] args)
   at Raven.Server.Program.Main(String[] args)

Does this mean that the restore option is not yet implemented in ravendb 4 or ?

Any idea of doing a restore on the linux ravendb instance ?

Thanks.

Oren Eini (Ayende Rahien)

unread,
Jan 4, 2018, 8:29:31 AM1/4/18
to ravendb
This is how you restore in 3.5, not in 4.0
The easiest way to see how to do that in 4.0 is to do that from the studio and pull the curl command from Chrome.

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vladimir Zlatkovski

unread,
Jan 4, 2018, 8:40:36 AM1/4/18
to RavenDB - 2nd generation document database
I can not find the restore option in the studio, does it exist in version 4?

I can see that there is only Import option...

Thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Jan 4, 2018, 8:41:38 AM1/4/18
to ravendb
Inline image 1
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Vladimir Zlatkovski

unread,
Jan 4, 2018, 9:29:33 AM1/4/18
to RavenDB - 2nd generation document database

Still could not do it...The error says: broken pipe.. 


Oren Eini (Ayende Rahien)

unread,
Jan 4, 2018, 9:36:10 AM1/4/18
to ravendb
I'm afraid that importing in this manner requires a Windows machine to run the exec.

To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Vladimir Zlatkovski

unread,
Jan 4, 2018, 9:41:59 AM1/4/18
to RavenDB - 2nd generation document database
So actually we can not do a restore on linux with the current version of ravendb , right ?

Oren Eini (Ayende Rahien)

unread,
Jan 4, 2018, 9:42:56 AM1/4/18
to ravendb
You can do a restore from _4.0_ in Linux, yes. But not from 3.5

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


On Thu, Jan 4, 2018 at 4:41 PM, Vladimir Zlatkovski <vladimir.zl...@gmail.com> wrote:
So actually we can not do a restore on linux with the current version of ravendb , right ?
Message has been deleted

Oren Eini (Ayende Rahien)

unread,
Jan 4, 2018, 10:35:51 AM1/4/18
to ravendb
Yes, that is available on Windows only.
Export files works everywhere.

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


On Thu, Jan 4, 2018 at 4:43 PM, Vladimir Zlatkovski <vladimir.zl...@gmail.com> wrote:
I meamt Restore from 3.x backup files ..

Vladimir Zlatkovski

unread,
Jan 4, 2018, 10:50:04 AM1/4/18
to RavenDB - 2nd generation document database
Okay..

I've tried to do the restore on windows raven db instance version 4 ( latest one ), from backup of ravendb 3.0 through the studio: https://image.prntscr.com/image/x4v0-4SRT1C0D0xG0TtfZQ.png

This is what i got: 
[3:43:52 PM INFO] Starting migration
The data export tool have exited with code -1073741819.
System.ApplicationException: The data export tool have exited with code -1073741819.
   at Raven.Server.Web.System.AdminDatabasesHandler.<>c__DisplayClass25_1.<<MigrateDatabaseOffline>b__2>d.MoveNext() in C:\Builds\RavenDB-4.0-RC\src\Raven.Server\Web\System\AdminDatabasesHandler.cs:line 1225

I've tried with the Raven.StorageExporter.exe from tools both version 3.5.4 and 3.5.5 from the ravendb site.

What I am doing wrong .. ? 


On Thursday, January 4, 2018 at 3:42:56 PM UTC+1, Oren Eini wrote:
You can do a restore from _4.0_ in Linux, yes. But not from 3.5

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


On Thu, Jan 4, 2018 at 4:41 PM, Vladimir Zlatkovski <vladimir.zl...@gmail.com> wrote:
So actually we can not do a restore on linux with the current version of ravendb , right ?

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Jan 4, 2018, 10:52:43 AM1/4/18
to ravendb
I don't understand:
* what you did?
* what OS you did it on?
* what were the inputs?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Vladimir Zlatkovski

unread,
Jan 4, 2018, 11:03:17 AM1/4/18
to RavenDB - 2nd generation document database
I've tried to do a restore on windows ravendb version 4 from backup created from ravendb version 3.0.

OS: Windows 10, x64
RavenDb version: 4.0.0-rc-40025
What I did: Through the studio of ravenDB tried to create "New database from  v3.x ( legacy ) data files" 
Inputs:
             Data directory: path to directory that contains the backup files from ravendb 3.0 ( C:\Users\Vladimir\Desktop\data ) 
             Data exporter: path to exporter exe downloaded from ravendb site ( C:\Users\Vladimir\Desktop\tools\Raven.StorageExporter.exe) 

Oren Eini (Ayende Rahien)

unread,
Jan 10, 2018, 8:11:15 AM1/10/18
to ravendb
Is this resolved?

To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Vladimir Zlatkovski

unread,
Mar 16, 2018, 8:43:50 AM3/16/18
to RavenDB - 2nd generation document database
No, its not.

Oren Eini (Ayende Rahien)

unread,
Mar 18, 2018, 3:16:04 AM3/18/18
to ravendb
Okay, let's get back to the beginning.
Restoring from a 3.x backup requires running on Windows.

You have tried that, and it failed? What is the failure that you got?
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages