I got this question just now asking how to sync and not loose apps on a new machine.
Well, I’ll share two methods right away
Use iCloud from apple
Use Media Rover to sync your entire library and it’s only available for windows
However, I’ll advise sticking to iCloud because it’s from apple and it feels safer.
Alternatively, you can sign in to your iTunes account before doing any sync, or transfer purchases before the sync. Also note that you can use your iTunes account on up to 5 computers and on as many other devices as possible.