Craft makes it nice and easy for us to have hierarchy in Structures or Categories. Many other popular CMS platforms support hierarchical data as well but some support it using a different data model.

Here's an overview of managing hierarchical data in MySQL if anyone's interested: http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql

In particular, I'm trying to understand the best way to migrate data that uses the Adjacency List Model into Craft which uses the Nested Set model.

Are there any tools to help translate how each item in the table of the adjacency list model refers to a parent to how the nested set model uses lft and rgt to identify how the items in the table are nested?

If there aren't any tools for this, is there any step-by-step process that might make this a bit more accessible? Or could I just be thinking about it the wrong way?

1 Answer 1


This looks like a good high-level description of how to go about it.

Also possibly useful: How do you convert a parent-child (adjacency) table to a nested set using PHP and MySQL?.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.