I agree with Pinky. It doesn't hurt to go cold turkey on junk food. Veggies are different as they have extremely different chemical make-up, water content, etc., and a lot of a new veggie could cause a tummie upset.
The piggies may take a while to eat the new pellets, but that won't hurt them. Pellets are the least part of the diet by weight, although unlike veggies they are high-calorie food (concentrated protein from hay).
My piggies took about a week to get used to proper pellets as opposed to the junk pellets their previous 'caretaker' had given them. (she gave me a big bag of it to take with them, but I put it in the trash. ) If that is all they get for pellets, they will eventually eat them--same principle as when you give them green peppers for the first time. It took a long time for the my boys to eat their peppers--2 weeks or more as I recall-- but now they come running when they hear the 'green pepper song'.