You can do something similar with Macs. Using Migration Assistant I was able to transfer all my data (.zsh, git repos, configs, Docker containers, everything.) Took less than an hour. In fact, I did this because I needed to upgrade my RAM
Yup, did this when I upgraded from a 2013 MacBook Air to a 2018 MacBook Pro. Everything worked great except for homebrew, which unfortunately had to be nuked and re-installed; but I can't really blame Migration Assistant for that.