Don't forget to mark the old lines and the messenger line so you remember where it goes.Buy a spool of light but strong cord/twine/string.. tie/sew one end to an existing halyard, then carefully pull it through and out of the mast. Cut the string (which now replaces the original halyard) with some extra length.
Repeat as required until all lines are out.
Take them to a nearby chandler and match size and length - but discuss your needs with someone there who knows rope. You can probably choose better line that what's there now, esp if you're not 'cheaping out'.
Then return to the boat, securely attach the new halyards etc to the light lines you put in place before - uses them to carefully feed the new halyards back into place. This time, with more 'drag' it's a good idea to sew the parts together - the last thing you want is for them to part at the first sign of resistance half way through.
... and you're done!
Keep in mind any shortcomings of your existing running rigging - deal with any that are too short or too long, but don't be afraid to leave 10 feet or so extra in any case; it allows you to remake an end if you're putting shackles etc on. I'd recommend tying halyards on (saves cost of shackles, weight aloft, splicing, and a dangerous swinging lump of metal if you lose grip on a halyard one day). It also makes it easy to end-for-end a halyard down the road if localized chafe or wear is an issue.
It's less risk of error if you measure the existing lines and adjust the lengths as needed.