backup all tenants DBs command ?

153 views
Skip to first unread message

devm...@hotmail.com

unread,
Jun 22, 2012, 8:29:02 AM6/22/12
to rav...@googlegroups.com
hi, 
i was able to test backup with raven.backup.exe with windows task scheduler, and it worked just fine, now i was wondering what is the command to backup all tenants DBS ?

thanks in advanced.

Oren Eini (Ayende Rahien)

unread,
Jun 22, 2012, 1:31:02 PM6/22/12
to rav...@googlegroups.com
Hi,
There is no way to do this right now.
You can get the list of tenants from 


And automate this.

This is probably something that we will have in 1.2

devm...@hotmail.com

unread,
Jun 22, 2012, 3:21:42 PM6/22/12
to rav...@googlegroups.com
Ayende, 
thank you for reply and taking this into account for next version.

but could you tell me if this syntax is right to backup database  called Test ?

Raven.Backup.exe --url=http://localhost:8080/databases/Test --dest=C:\Temp\Foo --nowait --readkey 

Oren Eini (Ayende Rahien)

unread,
Jun 22, 2012, 3:39:31 PM6/22/12
to rav...@googlegroups.com
Yes

devm...@hotmail.com

unread,
Jun 22, 2012, 3:47:58 PM6/22/12
to rav...@googlegroups.com
thank you Aynde

devm...@hotmail.com

unread,
Jun 26, 2012, 4:59:45 AM6/26/12
to rav...@googlegroups.com
Another Question Ayende please, 
should i backup the default DB, because it keeps track of tenants documents so i can access them from Studio ? 
and what is the command for that ? is it this
Raven.Backup.exe --url=http://localhost:8080/ --dest=C:\Temp\DefaultDB --nowait --readkey 

and when i restore the DBs what is the location i should restore them to, is the following correct? 

for Default DB
Raven.Server.exe -src c:\backup\ravendb\DefaultDB -dest c:\ravendb\web\data  -restore 

for TestDB
Raven.Server.exe -src c:\backup\ravendb\TestDB -dest  c:\ravendb\web\Tenants\Tenants  -restore 

the reason i am asking this because i am confused a little, as i see that there is Data Folder which has Index Definitions,Logs,System, etc... and Tenants folder which has a folder For each DB but also it self has folders like Index Definitions,Logs,System, etc...

thanks in advanced.

Oren Eini (Ayende Rahien)

unread,
Jun 26, 2012, 7:29:46 AM6/26/12
to rav...@googlegroups.com
Yes, you are correct.
The default db is just a standard db in all aspects, just used for system stuff.

devm...@hotmail.com

unread,
Jun 26, 2012, 9:59:54 AM6/26/12
to rav...@googlegroups.com
thank you Ayende

devm...@hotmail.com

unread,
Jun 26, 2012, 3:14:29 PM6/26/12
to rav...@googlegroups.com
Ayende, 

another question please, while i am backing up to the same location, will there be any conflict when i restore in case for example i backed up version 1 which had 2 indexs, now i backed up version 2 which have the 2 indexes from version 1 deleted and added 3 new indexes.

what i mean is will backup overwrite the folder structure completely or i have to delete the folder before each backup, because as i mentioned above i don't want to see the old deleted indexes coming back when restoring the DB

thanks in advanced.

Oren Eini (Ayende Rahien)

unread,
Jun 27, 2012, 3:22:42 AM6/27/12
to rav...@googlegroups.com
No, it does NOT work. In fact, if you are doing full backups, if you backup to the same location it would fail.
You can do incremental backups, instead, which can go to the same location.

devm...@hotmail.com

unread,
Jun 27, 2012, 8:17:04 AM6/27/12
to rav...@googlegroups.com
ohh, 
thank you man for the info, how can i do incremental backup if you dont mind asking ?

devm...@hotmail.com

unread,
Jun 27, 2012, 8:17:58 AM6/27/12
to rav...@googlegroups.com
Stupid me, it is in the Docs, just add an argument, but it also says you have to disable circular log, now this i don't know how to do :)

devm...@hotmail.com

unread,
Jun 27, 2012, 8:33:54 AM6/27/12
to rav...@googlegroups.com
ok again stupid me, i found it it is in web.config,

but there is a strange thing, after task is launched, it stays in running mode, and never complete, now i have test db very small almost 2 records inside, and incremental worked fine, is this normal, or i should see task completed message in the Task History ?

Oren Eini (Ayende Rahien)

unread,
Jun 27, 2012, 9:07:44 AM6/27/12
to rav...@googlegroups.com
Huh? What do you mean, it stays in running mode?
What command did you run?

devm...@hotmail.com

unread,
Jun 27, 2012, 12:38:08 PM6/27/12
to rav...@googlegroups.com
i think the backup is done, but the windows task scheduler interface is marking the task as running, and usually when task is finished you get a message in the Task history that the Task is completed. for example here is a message for SQL server backup that is done:
Task Scheduler successfully finished "{1818a160-d143-4a6b-ba34-4bcfba42197c}" instance of the "\SQLServer" task for user "P2382489\fAdmin".

as for the command, i created a batch file and added the following to it.
cd "D:\RavenDb\Backup"
Raven.Backup.exe --url=http://localhost:8000/ --dest=D:\++Backups\Raven\Default --nowait --readkey --incremental 

Oren Eini (Ayende Rahien)

unread,
Jun 27, 2012, 3:29:44 PM6/27/12
to rav...@googlegroups.com
--readkey override --nowait, you are waiting for a key to be ready

devm...@hotmail.com

unread,
Jun 28, 2012, 3:39:43 AM6/28/12
to rav...@googlegroups.com
Stupid stupid me again, 
thank you so much Ayende for patience and guidance, it is working perfectly now.

tur...@gmail.com

unread,
Mar 14, 2014, 7:46:38 AM3/14/14
to rav...@googlegroups.com
I am taking backup of all the tenants using code (Raven.Backup source code taken from https://github.com/ayende/ravendb). It was originaly for one dabase only. I have managed to get for all tenants using AllDataBaseNames() method and iterate on them. Using code what is the behaviour of nowait. By default the nowait is false? so the backing up is NOT ASYNC. but using code its continue asynchrously. if there are 15 tenants all the backups start at once n contine in backgrond. 

In source code there are 2 methods WaitForBackup() and GetStatusDoc(). WaitForBackup() is using thread.Sleep(100) (with comments Allow the server to process the request) what if backup takes long than 100 ms?

Im confused about it. What should do to take backups syncronously. suggestion please

Oren Eini (Ayende Rahien)

unread,
Mar 14, 2014, 2:00:40 PM3/14/14
to ravendb
What is the code you are using?

 RavenDB Conference

Oren Eini

CEO

Mobile: + 972-52-548-6969

Office:  + 972-4-674-7811

Fax:      + 972-153-4622-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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages