You CANNOT swap drives to retain your data. The only way to back up the old data and transfer it to a new PS3 is to use the old PS3's backup function and backup to an external drive. From there you can restore that data to a new PS3.
However, if you try to swap hard drives the new PS3 will detect it's a new drive and ask you to format it.
There is literally NO WAY around this and, I'm sorry to say, the data from the old PS3 is GONE.