On rebuilding valves, it usually can't be done because the spools are selected to fit just that spool.
You rarely see replacement spools.
Some of the high dollar spools have an o-ring seal kit where the spools exits the valve.
You can find the hose location by trial.
The pump hose should go to the IN port.
The PB hose should go to the next valve of hyd block.
The return hose should go to tank.
Work port hoses. I believe this is correct.
If joystick valve, move the lever briefly as fluid will come out.
--------------------- pull the lever back, that port should go to the base of the lift cyl.
---------------------push the lever fwd, that port should go to the rod end of the lift cyl.
---------------------push lever left, that port goes to the tilt rod end
---------------------push lever right ,that port goes to the base end to dump.
Another way is to take the lift set of hoses and connect to the A and B work port.
-------------------------------tilt ------------------------------------ C------D work port.
Activate the valve and see if the lift works correctly. If it is opposite, just reverse the hoses.