I was in this situation at the end of this school year. I waited till a couple days before school was out and then I told them. They were surprised but I told them we'd still see each other and hang out.
There is no best way to tell your friends that you are moving schools as goodbyes are always sad. Just call them up or talk to them when you are together and tell them that you will be moving schools. You can explain to them the reasons why you will be moving and offer a way that you will be keeping in touch.
Yeah i would have to agree, Just tell them when you are together but make plans to visit each other on holidays and stuff and keep in touch by texting or Facebook something like that. Cause it's always a good thing to keep your friends no matter how far you are cause they will always be there.