backdrop-contrib / biblio

Manage and display lists of scholarly publications. Import from Zotero.
GNU General Public License v2.0
0 stars 5 forks source link

Create an upgrade path from Drupal 7 "biblio fields" to Field module fields #21

Open GeoTimber opened 6 months ago

GeoTimber commented 6 months ago

@jenlampton Hi is there a conversion path from D7 1.x to backdrop and this backdrop module on the 2.x branch that preserves the data of the biblio module.

I am struggling to find an upgrade/conversion path to backdrop for an existing D7 site with a large amount of content, I found an upgrade path to the D7 3.x branch but that did also convert the biblio node into a separate entity, It kind of went a step to far.

If not I will have to make an export / import script I suppose.

Any hints welcome, thanks for all the good work.

jenlampton commented 6 months ago

Hi @GeoTimber,

is there a conversion path from D7 1.x to backdrop

Yes. The upgrade path for biblo went from 7.x-1.x to Backdrop 1.x-2.x.

I am struggling to find an upgrade/conversion path to backdrop for an existing D7 site with a large amount of content,

Can you explain which part of the process isn't working well for you? What data isn't converted properly? Is it the bibliographic references, or something else?

I would be interested in adding support for your use case, as I expect others would benefit from that as well.

the D7 3.x branch but that did also convert the biblio node into a separate entity, It kind of went a step to far.

I think most of the Drupal 7 biblio community agrees with you, since there was never an official 3.x release of the module. This is why the upgrade to Backdrop stated from the Drupal 7 1.x branch :) I'll make some updates to the readme to make this more clear.

edit: This should help a little bit: https://github.com/backdrop-contrib/biblio

GeoTimber commented 6 months ago

Hi @jenlampton
thanks a lot for your reply, now I know it should have worked from the 7.x-1.6 version.

After the upgrade to Backdrop the new Biblio tables were completely missing, that is there were no fieldable fields for the Biblio node nor was the Biblio module working, it was enabled but none of the configuration files were installed in the active configuration directory. So the biblio_pub content type wasn't there for example.

I assume something went very wrong during the upgrade, probably not related to Biblio, which I failed to notice and this inhibited the BD Biblio Module installing properly and doing its work.

I will repeat the upgrade from D7 and try to find out where it may have gone wrong.

I will post an update with the outcome soon,

thanks again for your reply, most appreciated, Joris

GeoTimber commented 6 months ago

@jenlampton

Ok tried again to upgrade from D7 to backdrop preserving the biblio content

Upgrade to backdrop reports no problem, oddly I see no updates for Biblio in the 297 update_n hooks, which make me suspect biblio fields are not going to be converted

result:

Old node type biblio is not migrated to biblio_pub

Old node biblio fields are no migrated to the new style biblio fieldable fields

Active config is not imported from modules/biblio/config_import - maybe related to https://github.com/backdrop/backdrop-issues/issues/3224

New style node fieldable fields and database structure not created, ( Active Config was not imported, and I doubt weather function biblio_install in modules/biblio/biblio.install ran at all, I suppose I should check that with a debugger. )

I can see no update_n hooks to convert the D7 1.x biblio structure to 2.x Backdrop Node structure, are you sure these two modules are compatible?

Help ?

GeoTimber commented 6 months ago

ok uninstall and install does run the install and creates the right tables and imports the active config, no data from the old D7 is converted still and it looks like it wont, the old data is still there but under content type biblio not biblio_pub

GeoTimber commented 6 months ago

For us the migration from D7 to Backdrop path involved writing a custom conversion module to convert the biblio nodes and fieldable fields to biblio pub nodes and fieldable, and this worked, if I have time I will post the module here, but if anyone needs to do this to feel free to ping me and I will pass on my work.

I think it is a fairly generic solution and will work for other conversions so it may save you some time.

All the best Joris

irinaz commented 3 months ago

@GeoTimber , we are are working on migrating two sites with biblio, what is best way to connect with you about your custom solution? thank you in advance!!

GeoTimber commented 3 months ago

@GeoTimber , we are are working on migrating two sites with biblio, what is best way to connect with you about your custom solution? thank you in advance!!

Hi @irinaz,

we just about completed our conversion project,

I have attached my custom conversion module called bibconv. Its not pretty and I suppose this should have been done with migrate, but it did get the job done and I left some comments in the file. Its based on brush commands.

I will drop you a line at the email address on your profile, feel free to contact me if you need some help or just want to have a brief chat to share our experience. bibconv.zip

irinaz commented 3 months ago

@GeoTimber , thank you so much! I will work through code and see if we can integrate it with current migration path in this module. I will share results as soon as we make some progress.

irinaz commented 3 months ago

We will probably convert to bee based on information about brush module https://backdropcms.org/project/brush

GeoTimber commented 3 months ago

Yes makes sense, that should be easy, cant remember right now why we chose brush, it should only change the invocation and you would have to replace the brush_log calls. Nice one

jenlampton commented 1 month ago

Hi All!

I'm working on the biblio upgrade path today, so returning to this thread also :)

Upgrade to backdrop reports no problem, oddly I see no updates for Biblio in the 297 update_n hooks,

If the updates were runing, you should be seeing the update for "Move biblio settings from variables to config."
https://github.com/backdrop-contrib/biblio/blob/1.x-2.x/biblio.install#L50C4-L50C50

It sounds like you might not have dropped and loaded in the Drupal 7 database the second time you attempted to run update.php. Once the script has been run once, it can't be run again, so it's necessary to delete the updated database (and config files) and then run the script again in order to try an upgrade for a second time.

Old node type biblio is not migrated to biblio_pub

This update is handled by the core Node module.

Old node type biblio is not migrated to biblio_pub

This update is handled by the core Field module.

I doubt weather function biblio_install in modules/biblio/biblio.install ran at all

Yes, that's expected. The install hook should not run during an upgrade, since the module was already installed in Drupal 7. That code is only for people who do not have any of the biblio configuration in the Drupal 7 database, and need to create it from scratch.

For us the migration from D7 to Backdrop path involved writing a custom conversion module to convert the biblio nodes and fieldable fields to biblio pub nodes and fieldable

I'm happy you found a good solution @GeoTimber. You did a (partial) migration instead of an upgrade! 🎉

I'm working on the upgrade path today and I hope to smooth out this process for future upgrades.

jenlampton commented 1 month ago

Comments from Gunnar Wolf in Zulip Chat:

Anyway -- I did as you suggested, and the good news is that the system no longer dies dramatically. However... It shows no sign of the module being active. /biblio is 404, the biblio-related fields in the views are still marked as broken, and the biblio nodes show no extra information (nor allow being edited)

I guess it's related to this being the upgrade of a preexisting site... Yes, I tried several times, and checked all of the tips you gave me.

Haven't find a way out of the misery :frown: Maybe it's better to create a new content type and migrate all of the "biblio" content to it? After all, I don't use that much of its functionality... and I'd stay with a core install.

Then I offered: I have a custom update hook for biblio I can send you, but you might need to create the content type first? I'll check and report back later.

jenlampton commented 1 month ago

My Backdrop upgrade code is all public in https://github.com/jenlampton/upgradenotes, and in these docs the site with biblio is code named arf. It was a Drupal 6 site, so there are 3 sets of upgrades that could be relevant:

I don't see anything in these files specific to Biblio, which doesn't match my memory, so I'm going to have a look through my git history to see if maybe there was a biblio_update module or somewhere else that code might have lived.

I'm also going to run the upgrade path from Drupal 7 to Backdrop and see what we're starting with.

jenlampton commented 1 month ago

Update: The Drupal 7 biblio module did NOT have Field module fields, these are all still biblio custom fields, so the Backdrop core upgrade will not upgrade them like other fields. A custom upgrade path is necessary for these - and it does not exist yet - hence everyone needing to DIY the data conversion.

We do currently have several ways to do this: 1) @GeoTimber 's bibconv module 2) My biblio.tgz module backup from 2018 🤕 3) @irina's feeds importer (which sounds like it might import from a separate Drupal 7 site) 4) a feeds importer I have used that imports from the current site's biblio tables into Field module tables

My game plan is to see if I can use #4 (since feeds module is already a requirement of biblio) to pull the data from the current database into Field module fields. I'm going to try to kick that off from an update hook, but if it gives me too much trouble I might fall back to a combination of #1 and #2.