Best (safest) way is doing it in the water. But if that is not an option then how you do it depends on your available materials and tools.
I've had to do it a few times and how I do it is I first raise the engine, then tie a heavy 3/4" line I have to a tree directly in back of the boat and pass the line through the two towing eyes on the transom. Then I put slack (about 3 feet) in the the winch cable and use my truck to start pulling the boat off the trailer. Once i get the winch cable taunt again I now have all the slack out of the rope anchoring the boat to the tree and I know where the keel is going to land so I stop and place a 3' long 8"x 8" I have under the keel as a cushion and several concrete blocks topped with wood under the port and starboard sides to keep it from tipping. Then I pull more of the boat off the trailer slowly until it tips down and makes contact with the braces I just mentioned. Once the boat tips backwards I know that the center of gravity is now off the trailer and hanging out in the air between the boat and the braces so I take my floor jack with a piece of 2 x 6 on top of it and position it under the center keel, as close to the rearmost main trailer crossbeam as possible and lift the boat off the trailer completely. Then I unhook the winch cable and can now easily pull the trailer out from under the boat. (The boat is now supported by the 8x8 in the rear, the concrete cribbing on each side in the rear so it can't tip and the jack in the center just forward of midships). I
DO NOT LOWER THE CENTER JACK! It's supporting a lot of weight and I don't want to disturb it.
Then I position the new trailer HOOKED UP TO MY TOW VEHICLE (At this stage the weight of the boat will cause the front of the trailer to tip up into the air if it isn't hooked up to the tow vehicle) as far under the boat as I can, hook the winch to the boat, put my vehicle in neutral, brake off and use the winch to pull my trailer back under the boat up to the jack. (I use the winch because I don't want to push the trailer under the boat with my truck because that will remove the strain from the rope anchoring the boat to the tree. possibly losing control of the boat). I slowly lower the floor jack until the boat sets down on the trailer, making sure that the keel is centered on the center roller of the trailer, remove the jack and continue using the winch to pull the trailer under the boat. Once the boat's center of gravity is on the trailer and it tips down onto the bunks or rollers I can then just remove the rope holding it to the tree and winch it the rest of the way up the trailer. I'm good to go.
Just a few notes of caution.
First: When positioning the new trailer under the boat keep it as straight as possible so your boat will line up properly with the bunks or rollers.
Second: NEVER, EVER go under the boat or allow anyone, especially children, near it while it's sitting free on the braces without the trailer under it.
Oh, ....and don't forget to adjust the new trailers tongue weight to the proper amount of weight on the ball before taking it out on the road.
