Its absolutely possible to do. Im doing almost the same thing on an upcoming project, im making a 7.62 by 25 carbine, and im using a RPD barrel (wich is a 7.62 by 39 also) First you need to completely cut off the already chambered area. For safety you need to research the minimum wall thickness for the 7.62 by 54. this is a much more powerful cartridge than the 39, so you need to make sure the chambered areas wall thickness is about half again of the minimum wall thickness (this is just an estimate, but its common sense to have as much metal as possible around the explosion thats happening right in your hands). Next you need to buy or make an chambering reamer. if you have a lathe, a milling machine, and are a very skilled machinist. you can make your own "D" type reamer. but i strongly discourage it if your a novice. I also absolutley agree with dteed4094 this is a very dangerous undertaking if your unprepared knowledge wise, or a safe fun project if you've done your home work, you choose.
always glad to help -A.G.