Forum OpenACS Q&A: Extracting file-storage objects from the file system

Hi,

I've had unbelievable success using OpenACS (v4.6.3) to provide secure file storage fuctionality to people in my company for over two years. We've had over 3000 registered users, averaged 500 distinct users per week, and stored 2.6 gigabytes worth of files. The web server has *never* gone down. But, I've been told that my department must get out of the web services business.

The people who have been assigned the tasks of hosting a file storage repository do not have the luxury of using OpenACS, sorry to say. They will be using a proprietry solution. I am trying to come up with ways to help these guys out. There are over 2000 files that need to be tranfered. For them to replicate the hierachical set of folders and individually transfer the files one by one would take them literally hundreds of man hours. When I created my instance of file-storage, I opted to store file files on the file system as appose to the database. As we all know, the files and folders on the file system are not represented by their file names, but rather some numeric designation that references the database for the actual file/folder name.

Has anyone written a package that would take the files and folders on the file system and write it back using the original file/folder names? The guys who would be inhertiting the data can deal with task much easier if the files are named on the file system as they are in file-storage.

I'll take any suggestion for making their job easier.

Special thanks to the OpenACS community for a great product.

Frank

Collapse
Posted by Nick Carroll on
Why can't you just download an archive of the contents of the folders from file-storage?
Collapse
Posted by Dave Bauer on
You can reconstruct the filename from the database and a Tcl proc. So you could create a list of all the full file paths.

Something like this:

set root_folder [fs::get_root_folder -package_id $package_id]
set path [cr_fs_path $storage_area_key]
db_multirow file_paths get_paths "select content_item__get_path(ci.item_id) as file_storage_path, :path || cr.content as file_system_path from cr_items ci, cr_revisions cr where ci.content_type='file_storage_object' and ci.live_revision=cr.revision_id"]

then you should have the pretty path that file storage displays along with the actual path in the filesystem where the file lives.

You'd need to run that for each instance of file storage.