You didn't specifically mention which part numbers you are using; I'm assuming you are using the newer profinet enabled CPU's. You mention distributed safety, so I assume you are using Simatic Manager, and Step 7 v5.5.
The first thing to note is that the 319 is physically wider than the 315, probably about 3x wider. You need to ensure you have space on the rack and in the panel. It still only takes up one "slot" though.
Second, make sure you have backed up any setup data necessary in the 315. This could be done by uploading some of the data blocks, or by writing down the values you'll need. I'm not sure if there's an easy way to take a snapshot of all current values in the PLC, or what data in your program you would actually need to recommission the system.
If you have not upgraded the program yet, you must do this in the hardware config. You should be able to right click on the CPU and replace it. If you upgraded to a 317 you should be able to upgrade the easy way, but I'm not sure if it will let you go all the way up to a 319 via this method (319's usually have 3 interfaces, 315's & 317's only have 2). You might have to create a new PLC, and then copy the IO and program over.
There are also certain blocks that might need to be edited, such as those involving TCP communication. They need to know specifically which port is used for communication, and the interface number changes when you upgrade from a 315 to a 319.
When utilizing the new, upgraded PLC, you will either need a new memory card, or you need to have cleared off the old one already. It is usually a best practice to set the IP address of the new PLC before downloading, but that is not required. If you try to do a HW download, it will allow you to search for the available PLC's to find the right one, and start downloading. It will send the HW config, which will include the correct IP address, but the changed IP address will break your connection. If you try to download, and search for it again, it will finish correctly. From there you can download the code.
Interestingly, if you have the same code and the same HW config, you should end up with the same safety signature. I've seen the signature stay the same in PLC upgrades in the past, but I can't guarantee it would be for you. If the sig doesn't change, that probably greatly simplifies re-certifying the safety systems.