When to tell your roommate and closest friends you are transferring?

Update:

I told my closest friends at the start of the semester. All but one of them were really supportive (this person wasn’t my roommate). I would say that it generally brings people closer to you than pushes them away. One of the kids got jealous and avoids me now, but it was awesome having everyone else rooting for me. So for anyone in a similar situation, don’t say anything right away, but when the time comes, there is generally a positive reaction.