IMO I would wait until seven months old when they are considered done growing if it is a smaller breed of bun. For a larger breed then I would wait until one year.
Any new food should be introduced slowly to avoid GI upset including a new pellet. The safest way to switch pellets would be to start out adding just a very small amount of new pellets to the old pellet. Each day slowly add just a little more of the new pellets to the old pellets. At the same time you want to add the same amount less of the old pellet until your bun is eating only new pellets. While transitioning to a new pellet you want to keep an eye for any signs of GI upset such as smaller poops, signs of pain or loss of appetite.