Variant 1: In the rarest of cases, internally routed cables run through a tube that is integrated into the frame. Maintenance would be very simple: old cable out, new cable in, done. Unfortunately, replacement is rarely that simple. If you look past the outer casing into the empty frame tube, the replacement is usually more complicated.
Variant 2: Here, the outer sleeves end at end stops on the frame, and the cable continues to run inside the frame without a sleeve. The easiest way to change the cable is to use a plastic liner as a guide.
Variant 3: If the outer casing runs continuously from the shift lever to the rear derailleur or front derailleur, the old shift cable can be used as a guide. In both cases: Never pull the liner or the shift cable out of the frame just like that. In most cases, only emergency solutions will help you.
Emergency solutions: If all attempts to insert a new train have failed, negative pressure may be the solution. Seal all openings in the frame, with the exception of the draught openings. Then thread a thin thread into the frame and try to suck it in at the outlet opening using a hoover.
PRACTICAL HELPERS
When changing internally routed drains, you should always have a plan before you figuratively open the patient's chest. There are also a few useful tools on the market that can make your work easier.
You can read this article or the entire BIKE 12/2017 issue in the BIKE app (iTunes and Google Play) or buy the issue in the DK shop reorder:

Editor