The best way to avoid coughing is to add "smoke free lungs" into the mix.

As long as you continue smoking, you will have bits of "tar" (the sticky residue from burning nicotine) clinging to the aveoli in your lungs.
So why is
vaping making you cough? "Glycols are hygroscopic. If placed in an atmosphere containing water vapor, they will pick up and retain moisture. This property is responsible for the many applications of glycols as humectants and dehydrating agents." (Source:
https://dow-answer.custhelp.com/app...e-glycols---hygroscopicity-&-humectant-values ) The vapor may be absorbing some of the moisture in the "tar" causing you to have a productive cough.
When switching from smoking to
vaping, many people find they go through a few weeks of hacking up some of the nastiness that had been building up in their lungs. So if you want the coughing to stop, your best move is to figure out a way to give up those last few daily cigarettes. In the meantime, you can change the way you vape to avoid the coughing: Instead of inhaling directly into your lungs, just suck the vapor into your mouth and then inhale/exhale through your nose. The nicotine in e-cigs can't be absorbed by deep lung tissue, so you don't really need to inhale at ALL except to create the familiar throat hit and coughing anyway.
If you are still wanting cigarettes after
vaping, it probably means that you are "addicted" to more than just nicotine: Get thee to a tobacconist and try some snus or dissolvables!

Keep a tin of snus or a pack of Stonewalls or Arivas around and take one any time that you feel like you want "the real thing" and let your body "detox" from years of smoking and the coughing WILL go away.