You can do it with no foam if you hook up a return tube from one in post to the other. you essentially get a siphon, so the beer feels no pressure change and thus does not foam at all.

Of course you can get by with judicious tugging on the relief valve too. The faster you go the more foam you will get. go slowly and you probably won't get a spray of beer on your knees near the end.
what bug said about purging the keg is very important though. Adding Co2 and pulling the relief valve a few times doesn't cut it.