Recovering an old (ancient) Drupal 5 site (part 2)

So, if you can’t import the data from the Drupal site to a new installation as we tried in part 1, what do we do? Well, I have access to the Sql database, so why not extract the important data and use it in a custom page?
I started by exporting the data as sql from the external server where the page is hosted with phpMyAdmin. I then loaded it in a local database server, and started to look around. I soon found out that the posts menu text was found in the table “menu_link_content_data”. This was found by browsing the tables and see what the contents of the different tables was. In the same way I found the posts text in “node__body”.

Then there was some investigation to find what made the link between these to tables. There wasn’t an obvious connection like an unique id or something. Instead I found that “menu_link_content_data” had a column named “link_uri” with values like “entity:node/5”. The title text in that row was found to correspond to the content in the node__body tables “body_value” column.
So if the table row has a link__uri that is “entity:node/5”, this is the menu text for the post with entity_id 5 in the node__body table.
This is important as the menu texts acts as a headline for the posts.
So, now I only have to write a script that gets data from the database, connect the right menu text to the correct post, and write ’em out on a web page. Simple as that 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *