The rim of a bicycle wheel can be exchanged for a new one. This can be done for maintenance, to replace a worn rim, or a rim can be replaced with a wider, narrower, or lighter rim to improve bicycle performance.
The accepted literature on the subject of wheels, by Brandt, explains in detail why good hubs can be kept with their initial spoke pattern because of the microscopic metal shaping happening at the spoke holes in the hub.
If there is a good hub worth keeping, especially if there is a good set of butted spokes in a wheel, it is worthwhile to put on a new rim. The drawback is that the project takes time, a few hours. However it is easy, swapping a rim can be done without unusual tools, skill or a mess.
1) Get a new rim with the same number of spoke holes, and a spoke wrench.
2) With a spoke wrench on your old wheel, loosen the nipples one by one progressively around. Loosen them until nearly off, but definitely not off, they need to keep the pattern.
3) On a table or even the floor, lay the old wheel on top of the new rim; align the valve holes and label lettering.
4) Loosen a nipple completely; flex the spoke out, then into the new hole. You can flex a spoke safely in the middle. (if you lose track of spoke pattern, look at hub adjacent spokes)
5) Screw on the nipples minimally initially; loose, so that the hub will find the center. After placing all the spokes, the wheel will be evenly floppy.
6) Progressively tighten each nipple a consistent rotation, you will have to go around the wheels a couple of times before they even get snug, then a couple more times to tighten. More times around is more accurate, making truing easier.
7) Put the wheel in your bike, spin it and look at the gaps at the brake pads. Look for the rim to go up and down, then look for side to side.
8) Fix up and down first. You really have to pay attention to which way tightening a screw works. Tightening the nut will shorten the spoke, pulling the rim in that direction. Then do side to side, visualizing same spoke pull concept.
9) Then consistently tighten each nipple ¼ turn. Then go around the rim and do it again, another ¼ turn. Go around one more time if you can.
10) Then fine tune truing.