That's true with a few cautions. The hub flanges (where the spoke holes are) on the new hub must be the same diameter as your old one. "Hooking up" the spokes must be done in a particular pattern and then tensioned and trued properly. The freehub and axle set must be arranged so that your drivetrain is properly aligned. Seven gears mean you must have SIS (indexed) shifting and also means you need to get a 7 speed cassette/freehub. You need a lot of detailed advice or you need the LBS to do the work.