Method for modernizing a hydraulic elevator to comprise a function for preventing an unintended starting of an elevator car, more particularly a passenger transport elevator and/or freight transport elevator, which hydraulic elevator comprises - an elevator car, which elevator car is guided by car guide rails (1, 2) for moving in an essentially vertical direction in the elevator hoistway, - a hydraulic system, which comprises - a lifting cylinder (5, 12), which is arranged in the space between the wall of the elevator hoistway and the elevator car, which lifting cylinder (5, 12) comprises a cylinder part essentially vertically supported on the base of the elevator hoistway, and a piston rod moving in relation to the cylinder part, which piston rod is arranged to move the elevator car along the car guide rails (1, 2), and - a hydraulic powerpack, which produces the hydraulic pressure needed for the lifting cylinder (5, 12), comprising - either a valve stack and a main shut-off valve, - or a rupture valve, - or a pressure relief valve or inward relief valve, - a control center, which comprises control means (17, 19) for controlling the movement of the elevator car, characterized in that the hydraulic powerpack is retained and an electrically-operating valve that is monitored with control means and that acts on the flow of hydraulic fluid of the lifting cylinder (5, 12) is added to the hydraulic system - either after the valve stack of the hydraulic powerpack before the main shut-off valve, - or integrated into the rupture valve or added beside it, - or is added into connection with the aforementioned pressure relief valve or inward relief valve, and in that the control means control the valve to prevent movement of the piston rod of the lifting cylinder (5, 12) downwards and/or upwards, if predetermined criteria are fulfilled like the status of the car doors and/or landing doors of the elevator car, more particularly the opening/closing of the aforementioned doors. - an elevator car, which elevator car is guided by car guide rails (1, 2) for moving in an essentially vertical direction in the elevator hoistway, - a hydraulic system, which comprises - a lifting cylinder (5, 12), which is arranged in the space between the wall of the elevator hoistway and the elevator car, which lifting cylinder (5, 12) comprises a cylinder part essentially vertically supported on the base of the elevator hoistway, and a piston rod moving in relation to the cylinder part, which piston rod is arranged to move the elevator car along the car guide rails (1, 2), and - a hydraulic powerpack, which produces the hydraulic pressure needed for the lifting cylinder (5, 12), comprising - either a valve stack and a main shut-off valve, - or a rupture valve, - or a pressure relief valve or inward relief valve, - a lifting cylinder (5, 12), which is arranged in the space between the wall of the elevator hoistway and the elevator car, which lifting cylinder (5, 12) comprises a cylinder part essentially vertically supported on the base of the elevator hoistway, and a piston rod moving in relation to the cylinder part, which piston rod is arranged to move the elevator car along the car guide rails (1, 2), and - a hydraulic powerpack, which produces the hydraulic pressure needed for the lifting cylinder (5, 12), comprising - either a valve stack and a main shut-off valve, - or a rupture valve, - or a pressure relief valve or inward relief valve, - either a valve stack and a main shut-off valve, - or a rupture valve, - or a pressure relief valve or inward relief valve, - a control center, which comprises control means (17, 19) for controlling the movement of the elevator car, - either after the valve stack of the hydraulic powerpack before the main shut-off valve, - or integrated into the rupture valve or added beside it, - or is added into connection with the aforementioned pressure relief valve or inward relief valve,