I used Miralax for one of my kids on the advice of the pediatrician (half capful once a day). However I recently read something about Miralax lately about adverse reactions and I am glad my child has weaned off of it. (http://www.gutsense.org/gutsense/the-role-of-miralax-laxa...)
But I will say that it did help make it harder to hold and easier to come out, but we also made the transition to pooping on the potty gentler on him by drawing out the process into multiple stages.
First stage was to have him ask for a pull-up when he has to poop. So he was in underwear and pee trained, but if he wanted to poop, he would ask for a pull-up. We would put it on him, let him do his business, then back to underwear. If it was a false alarm, we'd let him stay in the pull-up for 10 min and then take it off and say we could try again later.
Second stage was to have him ask for a pull-up, but have him stay in the bathroom while he had the pull-up on. He could stand, sit, or lay down on the floor...it didn't matter. All that mattered was that he was in the bathroom. We would let him read or play with a small toy. The key was to get him used to that the bathroom is where we poop.
Third stage was going to have him sit on the toilet with the pull-up on with the intention that we'd consider cutting a hole in the back of the pull-up to let the poop fall through into the toilet as the 4th stage. However, we got lucky and got him to try sitting on the toilet without the pull-up after stage 2.
I can't remember how long each stage was. We waited until we got some consistent results for a while. It took the stress out of the process as we reduced the battle for control over where to go in the beginning and worked more on going when we need to go, even if it was just in a pull-up.
And once we were ready for poop on the potty, we started to do small toy rewards for going. After X many times of going poop in the potty, we got him a bigger, bonus toy (trike) and declared him done with toy rewards.