Forum OpenACS Q&A: Help needed: StoreFilesInDatabaseP broken?

Hi all.

The last couple of days I was wondering why on earth my database is exploding even though I has set the StoreFilesInDatabaseP globally to 0 so that all files are stored on disk instead of the database.

The staggering reason: As soon as a class admin creates a subgroup the parameter is set back to 1 for this new group resulting all data being stored inside the database.

The result: a hybrid file storage system :( and I have the feeling that this will result to bad performance since most of the files are now stored to the database.

On the test server I tried to switch back to disk mode but of course this doesn't work. It still didn't work for file-storage instances where I had deleted all existing files, then switched back to disk mode and re-upload all files.

So my question is this...is there any way at all to solve this problem? I really think that all file-storage instances should obey the global StoreFilesInDatabaseP setting.

Also I don't know serious will become in future for our installations now that the system is hybrid and most of the stuff is stored in the database which I wanted to prevent.

:(

Collapse
Posted by Dave Bauer on
I don't believe there is a global parameter to store files in the database or filesystem. Currently it is application dependent.

There are two ways I can see to fix this.

1) Add a parameter to acs-content-repository for a default setting.

2) For dotlrn-fs have subgroups use the parameter of the file-storage instance of the main group.

In addition the latest verson of file-storage in CVS on the oacs-5-1 branch has been changed to storing files in the filesystem by default.

Collapse
Posted by Nima Mazloumi on
You are right. I just double-checked that. It is appl. dependent.

You suggestions are helpful for groups that will be created in future but do you see a way to change the StoreFilesInDatabaseP parameter for existing dotlrn-fs that have content?

Collapse
Posted by Tom Ayles on

You could override the parameter mechanism by sticking a couple of lines into your config.tcl:

ns_section ns/server/${server}/acs/file-storage
ns_param   StoreFilesInDatabaseP              0

This isn't best practice, but should work. It will override the parameter values for all instances of file-storage in your system.

Collapse
Posted by Nima Mazloumi on
But wouldn't this break all existing file-storage instances with their content?
Collapse
Posted by Nima Mazloumi on
Actually there is a global setting for the user folders under site-map: /dotlrn/file-storage/ which I assumed to be a global setting for all the files stored in the content repository.
Collapse
Posted by Tom Ayles on
I guess it would break all the instances that have written content to the DB instead of the file system. Overriding the parameter in this way is more of use as a preventative solution on a fresh install. Maybe it's possible to write a script to extract the file storage content from the DB and write it out to the file system (and then do whatever so the CR knows the content is stored outside the DB) to get the system back into the state you want.
Collapse
Posted by Tracy Adams on
If you would like to change the default parameter for NEW instances of
file-storage, you can do so from the apm:
(acs-admin/apm).  Select File Storage. Select Parameters. Edit
StoreFilesInDatabaseP.

This will set it up so that when new classes and communities are added, the
files will be stored in the file system for the corresponding file storages.
The rest of the package instances that were already there will stay as it was.

Collapse
Posted by Mark Aufflick on
I have changed this param on a server with existing data. New data goes to where you changed it to, and openacs knows how to get the old files from the db and new files from the fs.

Having said that, there are warning messages about doing this, so it might be bad. I haven't seen any probs though (although the one I changed is low-volume).

Collapse
Posted by Dave Bauer on
Mark, the value is stored in the cr_item. If you upload a new revision after changing the value, it will store the revision in the wrong place for that item.

It is possible this can be fixed by checking the status of an existing item, and using that instead of the package parameter.

Collapse
Posted by Don Baccus on
We should definitely have a global acs-content-repository "force files into the file system" parameter or some such.

And there should be a way to configure it for .LRN ...