Hydraulic pumps convert mechanical energy to hydrulic energy. They have two functions: They suck the fluid from reservoir to inlet by vacuum created with mechanical movement. They also send the fluid by mechanical movement to outlet. Hydraulic pumps do not create pressure. Pressure is an indicator of resistance to fluid.
Before installing new hydraulic pump, paying attention to the following points will prevent possible future problems:
1. Determine and eliminate cause of failure in old pump
2. Retract all cylinder rods and drain tank.
3. Flush tank. Using diesel fuel under pressure, flush tank thoroughly and wipe with clean cloths.
4. Install new filter elements. (min 10 micron) If there is no filtration in system, please install a return filter 10 micron.
5. Assembly new pump
6. Fill new oil to reservoir. Please pay attention using correct fluid. In normal conditions, it is recommended to use 46 cSt mineral based hydraulic oil. But it may vary based on different climates. In cold countries it is recommended to use 32 cSt oil, in hot countries it is 68 cSt oil. Please always check oil level during following steps.
7. Disassemble all connections going to actuators in the system. If there is an accumulator, it needs to be bleed before connecting the lines.
8. Activate each circuit by moving the control valve handle so lines are flushed with new oil. This flushes the lines and valves from pump to all cylinders and motors. Be sure to check oil level, and add new oil if necessary.
9. Connect lines to blind end of cylinders and all fluid motors. Leave rod end disconnected and with engine at one-fourth throttle, activate circuits slowly until cylinder bottoms out. New oil will be put in the blind end of the cylinder and old dirty oil flushed out the rod end. Do this for all cylinders in the machine.
10. Connect lines to rod end of cylinders. Again, check oil level and add new oil if required.
11. Operate all cylinders and motors alternately for 30 min. At full throttle.
12. Change filter element if necessary and check oil level.
13. Check oil temperature sight and make sure it is not more than 85 degrees celcius. After first start, please check new pump by hand and make sure there is no over heating. If there is over heating, check oil cooler in the system. 
The above procedure, if followed, will allow you to install a new pump with confidence, knowing that you will get satisfactory pump life. Cutting short these steps can cause premature pump failure, pump will not run long on a contaminated system. Dirt is the biggest enemy of hydraulic systems and components.
 Failuıre Analysis Hydraulic Gear Pumps, Fluid Power, Danfoss
Various pump manufacturer guidelines were also used during preparation of this post.