It depends on whether you are talking about your own school attendance as a pupil, or going to schools to work or for some other purpose.
If it is your experience as a pupil then ‘I used to go to elementary school but now I go to secondary school’.
If you are a worker at school or a visitor for some other reason, then either of the two examples you give could be used, depending on the context of the statement.
I have been doing voluntary tutoring in schools. I could say. ‘I had been going to a secondary school but now I am going to a primary school.’ If I had only recently switched then I might use the present perfect ‘I have been . . but I’m going . .’