New/old halyard
Sewing the two ends together works for me. I also cover the stitches with some light tape to avoid anything hanging up when it passes over the masthead sheave. But this method presumes you will cut off the old shackle in order to sew the old end to the end (the other end of which has a new shackle). But if you want to save the old halyard and shackle, say to keep as a spare or to use elsewhere on your boat, I sew a loop in the end of the old halyard. Attach a messenger line to it, and hoist the old halyard off. Attach the messenger line to a loop you've sewn in the new halyard, and hoist it up into place.