It's not rocket science. You can do it if you have a reasonable punt of mechanical aptitude.
Depending on the particular frames, not everything may be transferable, though. Seat tubes could be a different diameter, requiring a replacement seatpost. Bottom bracket shells could be different in type/size/threading, necessitating a different bottom bracket and maybe even a different crankset. Headsets could be a different type. The frame's head tube might call for a longer steerer tube on the fork. Depending somewhat on the frames' ages, they might call for different steerer tube diameters or even different types (threaded vs. threadless). If you're going threaded to threadless or vice versa, you'll need a different headset and stem.