While I understand that political prisoners were released and reimbursed what happened with the ordinary criminals? Did the sentences get adapted to the laws of the Federal Republic or did the original sentences remain? Were there new trials to prevent people still being locked up for political reasons?
Also as a follow up question: how was the prison infrastructure and staff continued? Were the wardens that were active in the GDR replaced by Westgermans, reeducated or did they just keep on working as before and just switched uniforms?
The GDR didn't cease to exist, it joined the Federal Republic instead. The Federal Republic thus is the successor state to the GDR, inheriting its debts and obligations, like both were to the German Empire.
The reunification itself is governed by the Einigungsvertrag (Unification treaty) in conjunction with the Treaty on the Final Settlement With Respect to Germany (for some reason better known as 2+4-treaty). The unification treaty makes a rather long and boring read. It includes hundreds of specific regulations, but also some general ones which help answer your question:
(1) Vor dem Wirksamwerden des Beitritts ergangene Entscheidungen der Gerichte der Deutschen Demokratischen Republik bleiben wirksam (…).
(1) Rulings made by courts of the German Democratic Republic issued prior to the admission [of the GDR to the Federal Republic] remain effective.
(My own crude translation.)
The treaty also specifies that political prisoners were to be released and that all rulings were up to review under the treaty, but within the court system.
As to the continuation of the prisons: in principle, they were continued as before. Same staff, same prisoners, same regulations. In the wake of unification, I'm sure however that staffers who were too obedient or affiliated with the Stasi were quickly replaced.
Prisons run by the Stasi, on that note, were already closed (or rather, opened?) prior to reunification, when the first and only democratic government of the GDR disbanded Stasi.