Wow someone still using 5.1

that must be year 2000 at least...
Any way you will have to remove any contribs and/or custom-templates , but I would probably do upgrade from 5.1 > 5.5 the 5.5 > 5.6 then you could then go striaght to 7.0 which a few people have done see bug tracker for any problems encounted.
Because you are on 5.1 there is a number of upgrades because there were major differences between < 5.5 and 5.6 >
What I would be tempted to do is install SME Server 7 on a new machine then recreate all users and ibays on 7 then rsync your data over nite.