how to duplicate master detail record

How can I duplicate my master detail tables for example order master to invoice master table and order detail to invoice detail table

The Master/Detail-Add feature can copy a master record with its detail records, see Tutorial - Master/Detail in the help file.