Upgraded to Drupal 9!

Submitted by HighKing on Fri, 02/11/2022 - 22:30

This site has been created around 2007 with Drupal 6, upgraded to 7 a few years later. Now the time has come to upgrade again.

Oh, wait... you can't. Drupal 7 and 8 or 9 are fundamentally different so you'll have to migrate all data from the old Drupal 7 installation to the new Drupal 8 or 9 one. I went straight to Drupal 9.

The basic process was explained pretty clearly on this page: https://www.drupal.org/docs/upgrading-drupal/upgrade-using-web-browser

But, after migrating all data from the old to the new installation I found that my blog was gone. The pages were there but there were no links to them so you'd have to know the url to each blogpost... which kinda sucked. ;-)

After installing the blog module I found that the /blog url worked again, but there were no articles in it. So I did a new migration from the old to the new installation now with the blog module installed. That helped getting the link to the blog back into the navigation menu but it still showed no articles... so I took a dive into the database.

I found that there are several tables in which node types are set to 'blog', BUT... when I made a new blog entry the type was 'blog_post'.

Fixed it with these statements:
update node set type='blog_post' where type='blog';
update node__body set bundle='blog_post' where bundle='blog';
update node_field_data set type='blog_post' where type='blog';
update node_revision__body set bundle='blog_post' where bundle='blog'

Aftet that, I cleared all caches (Administration -> Configuration -> Development -> Performance, click 'Clear all caches').

Now all my blog entries are back in place! Yay! :-D