How to efficiently clone database records together with all child elements
a new version of that page is created in a new record for auditing reasons.


How do you know which "version" is the latest, you're going to process on version and select the last one? That'll work, but I think you're barking up a pretty steep tree. Essentially you're building your own revision-control system in a database. Not saying everyone hasn't tackled that task before, but issues likely to come up are


Merging (other users)
Rollbacks (without which, why would you keep old versions)
Diff-views
Delta stores (why store the whole element when you only change one character)
etc, etc.


This gets super complex very fast. If you're wanting an out of the box solution, checkout gitlab. If you have speced to just stop here and not feature creep -- I think this will work just fine.