any year after 3rd, 4th, or 5th. moving after 5th should be okay actually, prior friends are also going to new different school, adjust to being brand new during 6th grade at smaller school, then some friends and acquaintances from 6th will presumably go to the same middle school for 7th (plus more kids to befriend if last year was difficult for some reason).