Yes, you can replace the keypad, and the codes will remain in the system. You will probably have to reset the panel, but it's reasonably simple. If you open the metal box that holds the main control panel (in a closet or some out of the way spot). On the inside of the door is a wiring schematic. On the bottom center is the model (D4112, D6112, etc). Depending on the model, it's simple to reset.