First, drive out the pin through the frame block.
Then make up a device simular to the Makarov barrel press devices that are being sold.
The press is made of two thick pieces of steel joined by large, long screws. Pad the front with brass, this goes against the muzzle.
The rear has a hole just big enough to allow the barrel to move back through it.
Use the press to press the barrel backward and out ot the frame block, by tightening the screws equally.
Reverse to press the new barrel in, remembering to pad the back with brass this time.
DO NOT try to drive the barrel out with a mallet.
DO NOT attempt to press the barrel out without good support of the frame block.