How to get history of mapping for following table data
System Version Tables in MariaDB-10.3 offers a range of features associated with versioning. This provides easy history viewing however its hard to trace changes.

Any table structure that preserves a unique unmodified key as the starting ID will make all required queries easier rather than resorting to CTE, procedures or other required recursive implementations.