If you had a previous DNI, you go later to registro civil with both DNI + the carta de ciudadania and you ask for an auto de identidad where they testify that both numbers belong to the same person but the last is the valid one.
Nowadays RENAPER is too picky with the finger print at the carta...