0

My task: to move the directory containing the databases and filesystems for a Ravendb-installation from one drive to another (because of disk-space issues) without moving or altering the Ravendb-installation itself.

I managed to move the databases by:

  1. shutting down the Ravendb service
  2. Moving the data-folder containing the subfolders Databasesand FileSystems
  3. Opening Raven.Server.exe.config and changing the value for the settings Raven/DataDirand Raven/FileSystem/DataDir
  4. Starting the Ravendb service again
  5. Tricky part: going to some (not all) databases using Raven Studio and choosing Settings > Database Settings and changing the value here (again) for Raven/DataDir. So apparently, somehow, for some of my databases, this value was overridden in some metadata for the db itself rather than using the tilde to look relatively to the global setting (although the actual db or db definition or something was being loaded correctly, since I could even see this setting/value)

enter image description here

So far so good. But here the problem:

Apparently, too, for some filesystems (again not all), Ravendb seemed to think, their "data-data" was still in the old location (again, the actual filesystem metadata seemed to be loaded from the new location). But alas, filesystem do not have something similar to Database Settings in Raven Studio where I could change this data-dir, probably overridden here too.

The way I know the filesystems' data is assumed to still be in the old location, is that I can see new folders being created in the old location with the name of the respective filesystems.

I tried going to the system db (Main Window > Manage Your Server > To System Database), but the file-systems do not appear here.

So my question is: how can I change or set the Raven/FileSystem/DataDir setting for a single filesystem?

Frederik Struck-Schøning
  • 12,981
  • 8
  • 59
  • 68

1 Answers1

1

Eureka, I found this out:

The error was indeed, that for some reason, my filesystems do not appear in the system db when viewed in Raven Studio. I realized this, because the status-bar in the system db said 40 documents, but fewer were visible in the list. This must definitely be a bug in Raven Studio.

The solution: In system db, put my mouse cursor in the quick-goto-/search-field in the top ("Go to document") and typed Raven/FileSystems/ and from here on, the autocomplete would show me the available filesystems. Choosing the correct filesystem, I was now able to edit the (indeed overridden) path to the filesystem, which was set to an absolute path.

enter image description here

Note, that in general you should definitely use a path relative to the Raven/DataDir and Raven/FileSystem/DataDir settings, like e.g. ~\filesystems\my-db to more easily be able to move all dbs and fs'es around collectively.

Frederik Struck-Schøning
  • 12,981
  • 8
  • 59
  • 68
  • Creator of Raven Studio here. FYI, you can also get to that document via the Raven Studio GUI: Click the yellow Manage Your Server button, then cick "To System Database". All your system documents, including Raven/FileSystems/my-fs will be listed there. – Judah Gabriel Himango Jul 27 '16 at 14:38
  • Hi @JudahHimango, thanks for your answer. But as I wrote, the case was exactly, that all my 11 filesystems do not appear in the list that you mention. The statusbar says "40 documents", but I see only 29. If you want to debug, I can send you my system db, screenshots or what you need. – Frederik Struck-Schøning Jul 27 '16 at 20:07
  • Changing the directory in the system document isn't the right way to move a file system. To move a Raven file system, in the Studio, click on your file system, then click Tasks, then click Export File System. Once exported, create a new file system in the proper directory, then go Tasks -> Import. – Judah Gabriel Himango Jul 29 '16 at 14:59
  • Thank you, @JudahHimango. But being the case, that I actually managed to move my filesystems in the way described, so far with no apparent drawback, can you tell, if there's any problem in doing it that way? It *is* with no doubt an easier (and faster) way. – Frederik Struck-Schøning Jul 29 '16 at 20:39
  • 1
    I don't know if you'll hit problems. It's kind of like asking your car dealer what can go wrong if you manually add a second fuel tank. It may work fine, or it may explode. :-) In your case, I'd highly recommend you export the file system, then create a new file system in the desired directory, then do an import to bring the files in. It'll take all of 60 seconds, and you'll be on the supported path. – Judah Gabriel Himango Aug 01 '16 at 16:20
  • 1
    Haha, @JudahHimango. That's a really good point :) At this point, though, I already did the move in the warranty-void kind of way, and it hasn't exploded so far. Fingers crossed. But I guess I should go on the safe road next time. Thanks, mate. – Frederik Struck-Schøning Aug 09 '16 at 08:20
  • Final note @JudahHimango: you should look into the issue where the Studio "hides" some/all of the file-systems from the list when visiting the "System Database" page. Write me, and I'll send you screenshots, db-dumps or the like if needed. – Frederik Struck-Schøning Aug 09 '16 at 08:22
  • Was it hiding some file systems from the list before or after moving them? If you like, email me judahgabriel@gmail.com, or feel free to raise this in the Raven DB mailing list: https://groups.google.com/forum/?fromgroups#!forum/ravendb – Judah Gabriel Himango Aug 09 '16 at 15:56