Move existing assets to different filepath

We have an OMEKA site where most of the assets are on a private AWS S3 account. This involves well over 1000 files (generally 1 file per OMEKA item). We now want to move those assets to a different server (URL). Is there a procedure for doing this short of manual deletion and manual re-upload? I expect to change config.ini to eliminate the original AWS credentials. I would also expect to move the files and then enter new URL into (at least) one of the OMEKA data tables. Thanks in advance for your help.

If you are doing a new install on Omeka, the API Importer plugin might do the trick.

Not all plugins work with it, but most of the most-used do.

No, this is an existing OMEKA installation. What I am looking to do is to move the files (that, we can do in bulk through BASH scripting) and then assign the new file-path to the files.

If that is not possible, then I would expect to do the following: download all the original files into a directory (done in bulk through Emacs and BASH scripting), rename all the files to their original names (use data from the omeka_files table, Emacs and BASH scripting), remove the S3 credentials from ./application/config.ini, mass delete the files ('truncate' the omeka_files data table) and then re-upload all the files through the CSV import plugin.

My concern here would be, where would OMEKA place the newly uploaded files?

Will the mass deletion and then re-import cause other problems in the OMEKA installation?

Thanks in advance for your help.

Your BASH and Emacs fu is clearly greater than mine!

That said, I don't think that CSV import is the cleanest way to go. CSV import creates new Items, and it sounds like you don't want to mess with or recreate existing Items -- just want to make the file path different.

I haven't tried something like this myself, so I might be missing things. But, the way the files table stores things I _think_ only cares about the storage path -- it works from the hashed filenames and looks for them whereever the storage is set to.

So, it might work to try this:

Work the BASH/Emacs/other magic to move the files from S3, and recreate the file structure. Should be something like this:


That's probably the same that you'll see on S3. Placing the files in those corresponding directories is likely the first step.

Then, you could try just switching the info in config from using S3 to using local storage.

Like I said, I've never done something like this, so I'd keep backups and definitely not delete or truncate anything.

Thanks so much. Your suggestion worked very well.
Here are a few comments:
Copy files from S3 into ./files/fullsize, original &c. as noted above.
Once the files are copied, edit ./application/config/config.ini. Look for the line
; Sample S3 cloud storage configuration
Then comment the line:
storage.adapter = "Omeka_Storage_Adapter_ZendS3"
Comment the line beginning:
storage.adapterOptions.accessKeyId =
Comment the line beginning:
storage.adapterOptions.secretAccessKey =
Comment the line:
storage.adapterOptions.bucket =
At this point, OMEKA will assume that file storage is on your web server at ./files/fullsize &c.
Reversing the above (uncommenting the lines noted above, adding your AWS credentials and target bucket) causes OMEKA to assume storage on S3.
There is no reason to interact with the MySQL tables during this exercise.

Excellent! Glad it worked, and many thanks for adding the detailed comments.