Rim replacement is a fairly common repair, and well within reach of the competent mechanic that has yet to perform a ground-up wheel build. If you can true a wheel, you can replace a rim. Brakes pads can slowly wear through the sidewall over the miles, a sharp edged pothole can badly ding the edge, or an old fashioned wreck can leave you with a rim bent beyond truing. Assuming the wheel isn’t full-on taco’d with bent spokes and the nipples aren’t corroded beyond turning, in most cases the spokes and nipples themselves are perfectly fine to reuse. With an identical or very similar rim you can move the spokes over one-by-one preserving the lacing pattern and spoke head angle, and taking much of the mystery out of a wheel build.