Traversal tree - repair

Multi tool use
Traversal tree - repair
please, do you have any tips, where to find code or solution, how to repair traversal tree?
I have table with cols lft, rgt, parent_ID and lvl and when I was moving nodes in this tree, I had fail in code so it broke lft and rgt indexes and I need to recount it.
One solution, which I think is applicable is getting all nodes from table, store in array for example, clear table and recreate it, but this solution is not so efficient I think.
Do you have any tips, how to solve it better?
Thank you very much :)
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Please read: How to create a Minimal, Complete, and Verifiable example and also How do I ask a good question?
– Magnus Eriksson
Jul 1 at 9:14