You're doing it right... at least, you're doing it the way I would do it - two machines with different php versions and doing the switch at 4.0.x.
If I'm not mistaken (and I remember correctly), 3.10.0 and 4.0.0 (and 3.10.1/4.0.1) are the exact same code except one is for php4 and the other is for php5. So you can switch machines and start the upgrade process from there.