You left your schooling maybe leaving your best friend. You might have done the same with your college. You moved to different place leaving your family. But still you are here. I understand parting ways is part of life. Stay connected on call and meet in person whenever you get time. Also find new mentor in workplace if you could. Please also note that when you both part ways, both of your priorities change. You might not be able to spend same amount of time in future. But live in the moment now, spend good time with your colleague friend now and also live fully whenever you meet them. Also check your emotions if you are getting any negative feelings that he's moving out. Please stay away from them. This is not a race.
All the best.