How can I repair this sewer cap?
If the pipe itself is in good enough shape, you could just use a compression cleanout plug (sometimes called a mechanical cleanout plug) or a pressure testing plug:




There are quite a few different styles of these, but almost all of them work by compressing and expanding a rubber gasket inside the pipe. 2.5" might be hard to find at the big box stores, but they are available numerous places online. The main consideration would be finding one that would seat deep enough into the pipe that it would be beyond the notches for the old cap.