Backport fix-mptt command

Backport is trivial as the code to fix the mptt tree already exists in the code base.