Where to run a script

Hi folks,

I’m new to Omeka and just starting to figure it out. I have about 200 items for which I want to add data that I wish I’d included in the initial ingest. Looking through the forum I found this post which offers a script for updating element text, which I think is just what I need:

But I don’t know where to put the script! This is my first time monkeying with Omeka’s PHP side. Is there a guide on how to get started implementing a script like this?

Is there a place in the GUI admin side where I can run a script, or something I need to do on the Linux backend side? Any help getting started would be much appeciated.


PS - I assume it’s a bad idea to just write a bunch of SQL statements to insert lines into the element texts table, right? That’d be easy, but probably wrong, right…?

Writing SQL to insert element texts will actually work fine if that’s what you’re comfortable with… the main thing is you’d need to go into the search settings and manually reindex after doing that for the search to work correctly with your new values. Obviously it’s not something we can officially support, but the element texts setup is pretty straightforward.

Typically if you’re going to add code to Omeka the way to do that is with a plugin. There’s also some existing plugins that may do what you want… there’s a “plus” fork of CsvImport that can do updates, as well as the Bulk Metadata Editor plugin.

Thanks! I had figured that direct SQL might mean that I did only half the job and that some other table somewhere should also be affected (I’ve made that mistake with WordPress before). Direct SQL is easy if it isn’t wrong. And thanks for the plugin too!

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.