Apple’s Migration Assistant can save you the time of reinstalling apps and preferences and so on—hours generally. But I’ve had trouble with it—often it hangs, particularly if the connection is wireless (and wireless is hopelessly slow, taking most of the day for a large transfer). But in migrating my 2015 iMac 5K to the 2017 iMac 5K, it hung even using gigabit ethernet.
Besides hang bugs, there is speed as an issue. If the two Macs both have Thunderbolt, then a speedier way to connect to two is to join them with a Thunderbolt cable.
Shown below (toggle), the transfer with gigabit ethernet was much slower, and ended up hanging. Connecting a Thunderbolt cable got the job done much more quickly, and with no hang (not to say it will not or cannot, but I’ve had more luck the faster the connection).
With a 2017 iMac 5K, you’ll need the Apple Thunderbolt 3 Male to Thunderbolt 2 Female Adapter to connect a Thunderbolt 2 cable into the 2017 iMac 5K (it has Thunderbolt 3 ports).