(2)All orders for the detention of lunatics made and all undertakings given under any enactment hereby repealed shall have the same force and effect as if they had been made or given under this Act and by or to the authority empowered thereby in such behalf.