Check with your Building Inspection Department and the public water supplier agency for local code and rules.
A homeowner can usually DIY replace the main supply line (not difficult at all), unless it is very deep and requires a backhoe, etc.
Here in the sunny South of rural NC, it only has to be about a foot or so deep to get below the frost line, but if you're up North, it may be way deep.
When the local County ran County water here a number of years ago, most everyone DIYed it with a portable trenching machine and PVC or copper line.
The County was responsible for the line to the meter, but would install the line from the meter to the home "at-cost", if the homeowner chose. (All meters here are at the nearest public road right-of-way.) Maybe your local public water utility will replace the line at a reasonable cost, or maybe they require a licensed plumber.
A "back-flow preventer" (check valve) and shut-off valves on the home side at the meter and at the home are required here.
All depends on local code and where you live. I agree with Gary. The best is to replace it with 1" Type K copper line, especially if you're up North (and the water isn't acidic). Down here where the public water is sometimes acidic, PVC (which I did) is fine. My 2 cents. DIY, if you can.
Good luck!
Mike