first- connect power to both laptops.
Make sure you know which laptop is the source and which is the destination.
The source should be in Recovery Mode ( using Command+r)
and The destination should be in Target Mode ( using the letter T on hold while the laptop boots)
In the source go to the menu and choose Terminal.
start with the command Diskutil list to see which disk is your source (should be disk0) remember which disks appear
Later connect the destination laptop with a Thunderbolt cable.
Now repeat the command Diskutil list and check for the added disk that indicates External disks (you should 2 partitions, but it doesn't appear in every mac)
Type the command diskutil umount (the partition should be the Machintosh's partition)(with the S1 or S2 and so)
Now type the following command while making sure to verify which mac is the destination and which is the source
for x in {0..500}; do echo $x; dd if=/dev/rdisk0 of=/dev/rdisk19 bs=1048576000 count=1 seek=$x skip=$x; done
Triple-check the spelling and the disks
Now let the process finish with 500 lines and then boot the new mac.
Should work now