After Barney moves to Raleigh, he still makes it back to Mayberry for visits. However, after Barney joins the Raleigh police force, he rarely has the occasion to wear his old Mayberry deputy uniform.
But he does still have the old salt and pepper suit, which is just perfect for a big city detective.