Upgrading to Omeka 2.0 with a non-standard element set

67 views
Skip to first unread message

Anne Wootton

unread,
Feb 15, 2013, 5:05:40 PM2/15/13
to omek...@googlegroups.com
Hi Omeka dev group,

Our archive is currently using an element set created by means of a simple plug-in that adds a new table in MySQL. We have updated that plug-in for Omeka 2.0. My concern is the following: will something break or will we lose data if we deactivate the 1.5x plug-in, upgrade our site to Omeka 2.0, then install and activate our upgraded 2.0 element set plug-in? Will we be able to run Omeka 2.0 with the deactivated 1.5x plug-in, or do we need to uninstall the 1.5x plug-in — and if we do, how best to ensure that we don't lose data?

When we install the upgraded 2.0 element set plug-in, it will attempt to create another table in MySQL, which will already exist because it will have been created by the 1.5x plug-in. Is there a good way around this? A simple check we could add to the code to verify whether or not the table already exists, so that it doesn't throw an error if the table is already there?

If helpful: here's the 1.5x version of the plug-in: https://github.com/annewootton/PBCore-Element-Set.git
And here's the 2.0 version: https://github.com/Daniel-KM/PBCoreElementSet.git

Many thanks,
Anne

Patrick Murray-John

unread,
Feb 18, 2013, 1:30:18 PM2/18/13
to omek...@googlegroups.com
Hi Anne,

Deactivating the plugin won't delete any data. From the look of things,
it should be as easy
as deactivating the plugin, upgrade Omeka to 2.0, replace the plugin
code with the new version, and update it. Since it will be upgrading
rather than installing, there shouldn't be any clash of table names.

That's assuming that there are no changes to the element set between the
versions. If changes need to be made, the upgrade hook is the place to
handle any of that.

Incidentally, a bugfix release of Omeka is due out this week. It fixes
some problems in the upgrade of exhibits, among other things.

Patrick

On 02/15/2013 05:05 PM, Anne Wootton wrote:
> Hi Omeka dev group,
>
> Our archive is currently using an element set created by means of a
> simple plug-in that adds a new table in MySQL. We have updated that
> plug-in for Omeka 2.0. My concern is the following: will something
> break or will we lose data if we deactivate the 1.5x plug-in, upgrade
> our site to Omeka 2.0, then install and activate our upgraded 2.0
> element set plug-in? Will we be able to run Omeka 2.0 with the
> deactivated 1.5x plug-in, or do we need to uninstall the 1.5x plug-in
> � and if we do, how best to ensure that we don't lose data?
>
> When we install the upgraded 2.0 element set plug-in, it will attempt
> to create another table in MySQL, which will already exist because it
> will have been created by the 1.5x plug-in. Is there a good way around
> this? A simple check we could add to the code to verify whether or not
> the table already exists, so that it doesn't throw an error if the
> table is already there?
>
> If helpful: here's the 1.5x version of the plug-in:
> https://github.com/annewootton/PBCore-Element-Set.git
> And here's the 2.0 version:
> https://github.com/Daniel-KM/PBCoreElementSet.git
>
> Many thanks,
> Anne
> --
> You received this message because you are subscribed to the Google
> Groups "Omeka Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to omeka-dev+...@googlegroups.com.
> To post to this group, send email to omek...@googlegroups.com.
> Visit this group at http://groups.google.com/group/omeka-dev?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Anne Wootton

unread,
Feb 18, 2013, 6:15:03 PM2/18/13
to omek...@googlegroups.com
Hi Patrick,

Great, thanks for clarifying. To be explicitly clear: to upgrade the plugin, I do not re-install the plugin v2.0, but rather drag the 2.0-compatible files into the (formerly 1.5x) folder once I have deactivated the 1.5x plugin and upgraded Omeka to 2.0 — right? 

Am I correct that this manual "upgrading" doesn't make use of the upgrade hook at all (which should be fine, since the element set is not changing between versions)?

Duly noted on the forthcoming bug fix — appreciate the heads up.

Thanks again,
Anne


On Mon, Feb 18, 2013 at 10:30 AM, Patrick Murray-John <patric...@gmail.com> wrote:
Hi Anne,

Deactivating the plugin won't delete any data. From the look of things, it should be as easy
 as deactivating the plugin, upgrade Omeka to 2.0, replace the plugin code with the new version, and update it. Since it will be upgrading rather than installing, there shouldn't be any clash of table names.

That's assuming that there are no changes to the element set between the versions. If changes need to be made, the upgrade hook is the place to handle any of that.

Incidentally, a bugfix release of Omeka is due out this week. It fixes some problems in the upgrade of exhibits, among other things.

Patrick


On 02/15/2013 05:05 PM, Anne Wootton wrote:
Hi Omeka dev group,

Our archive is currently using an element set created by means of a simple plug-in that adds a new table in MySQL. We have updated that plug-in for Omeka 2.0. My concern is the following: will something break or will we lose data if we deactivate the 1.5x plug-in, upgrade our site to Omeka 2.0, then install and activate our upgraded 2.0 element set plug-in? Will we be able to run Omeka 2.0 with the deactivated 1.5x plug-in, or do we need to uninstall the 1.5x plug-in — and if we do, how best to ensure that we don't lose data?


When we install the upgraded 2.0 element set plug-in, it will attempt to create another table in MySQL, which will already exist because it will have been created by the 1.5x plug-in. Is there a good way around this? A simple check we could add to the code to verify whether or not the table already exists, so that it doesn't throw an error if the table is already there?

If helpful: here's the 1.5x version of the plug-in: https://github.com/annewootton/PBCore-Element-Set.git
And here's the 2.0 version: https://github.com/Daniel-KM/PBCoreElementSet.git

Many thanks,
Anne
--
You received this message because you are subscribed to the Google Groups "Omeka Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omeka-dev+unsubscribe@googlegroups.com.

To post to this group, send email to omek...@googlegroups.com.
Visit this group at http://groups.google.com/group/omeka-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "Omeka Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omeka-dev+unsubscribe@googlegroups.com.

Patrick Murray-John

unread,
Feb 19, 2013, 9:11:11 AM2/19/13
to omek...@googlegroups.com
Hi Anne,

Yep. No uninstall/reinstall. Just deactivate, upgrade to Omeka 2.0, replace plugin files. Omeka will then tell you that an upgrade is available and give a� button to click to upgrade on the plugin page.

Omeka keeps a table of plugins and the installed version in its database, then compares that information with what is in the actual plugin.ini for the plugin. If the plugin.ini version info says it's newer, that's how Omeka knows there's an upgrade available.

It's a little different about what makes the upgrade hook happen. That upgrade button is actually what fires off the upgrade hook, if present. So if there's no work to do in the upgrade and thus no hook, very little will happen. It'll just update the installed version info in the database.

Good luck!
Patrick



On 02/18/2013 06:15 PM, Anne Wootton wrote:
Hi Patrick,

Great, thanks for clarifying. To be explicitly clear: to upgrade the plugin, I do not re-install the plugin v2.0, but rather drag the 2.0-compatible files into the (formerly 1.5x) folder once I have deactivated the 1.5x plugin and upgraded Omeka to 2.0 � right?�

Am I correct that this manual "upgrading" doesn't make use of the upgrade hook at all (which should be fine, since the element set is not changing between versions)?

Duly noted on the forthcoming bug fix � appreciate the heads up.

Thanks again,
Anne


On Mon, Feb 18, 2013 at 10:30 AM, Patrick Murray-John <patric...@gmail.com> wrote:
Hi Anne,

Deactivating the plugin won't delete any data. From the look of things, it should be as easy
�as deactivating the plugin, upgrade Omeka to 2.0, replace the plugin code with the new version, and update it. Since it will be upgrading rather than installing, there shouldn't be any clash of table names.


That's assuming that there are no changes to the element set between the versions. If changes need to be made, the upgrade hook is the place to handle any of that.

Incidentally, a bugfix release of Omeka is due out this week. It fixes some problems in the upgrade of exhibits, among other things.

Patrick


On 02/15/2013 05:05 PM, Anne Wootton wrote:
Hi Omeka dev group,

Our archive is currently using an element set created by means of a simple plug-in that adds a new table in MySQL. We have updated that plug-in for Omeka 2.0. My concern is the following: will something break or will we lose data if we deactivate the 1.5x plug-in, upgrade our site to Omeka 2.0, then install and activate our upgraded 2.0 element set plug-in? Will we be able to run Omeka 2.0 with the deactivated 1.5x plug-in, or do we need to uninstall the 1.5x plug-in � and if we do, how best to ensure that we don't lose data?


When we install the upgraded 2.0 element set plug-in, it will attempt to create another table in MySQL, which will already exist because it will have been created by the 1.5x plug-in. Is there a good way around this? A simple check we could add to the code to verify whether or not the table already exists, so that it doesn't throw an error if the table is already there?

If helpful: here's the 1.5x version of the plug-in: https://github.com/annewootton/PBCore-Element-Set.git
And here's the 2.0 version: https://github.com/Daniel-KM/PBCoreElementSet.git

Many thanks,
Anne
--
You received this message because you are subscribed to the Google Groups "Omeka Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omeka-dev+...@googlegroups.com.

To post to this group, send email to omek...@googlegroups.com.
Visit this group at http://groups.google.com/group/omeka-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



--
You received this message because you are subscribed to the Google Groups "Omeka Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omeka-dev+...@googlegroups.com.

To post to this group, send email to omek...@googlegroups.com.
Visit this group at http://groups.google.com/group/omeka-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "Omeka Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omeka-dev+...@googlegroups.com.

To post to this group, send email to omek...@googlegroups.com.
Visit this group at http://groups.google.com/group/omeka-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
�
�

Caitlin Nelson

unread,
Apr 12, 2014, 5:46:21 PM4/12/14
to omek...@googlegroups.com
Hi Patrick, 

Sorry to buzz in on an old thread, but similarly we are working on a custom PBCore element set and I wonder how I can add or remove fields from the element set without deleting the rest of the fields or any data already stored in them?  I tried the upgrade process by editing the elements.php file (to add a field, say), editing the plugin.ini to a higher version number, and saving.  I then hit the 
upgrade" button in Omeka, but it didn't seem to take the new field - nothing appeared in the Element Set admin panel, and nothing appeared in any Item edit page either.  Same when I tried deleting a field.  It would be awesome to have the ability to add a new field without having to uninstall (and thus wipe out all the data stored for any items) - am I doing it wrong?  Thanks!  (We're on Omeka 2.1.3).

Caitlin

Patrick Murray-John

unread,
Apr 16, 2014, 10:29:56 AM4/16/14
to omek...@googlegroups.com
Caitlin,

Sorry for the slow response!

My guess is that in your customization of the PBCoreElementSet plugin, you haven't included the upgrade hook. That would probably look very similar to the existing install hook that creates the new elements.

Regarding deleting fields, I'm not entirely sure what would happen, but if there is existing data I'd worry a little about deleting elements. I think it's possible that it could lead to errors, though I'd have to experiment to know for sure.

Patrick
Reply all
Reply to author
Forward
0 new messages