Remove the battery from the rear rack.
Unplug the power plug from the port in the bike frame and unbolt the rack from the frame.
Unwrap the coils holding the wires together and remove the tail light. You will have to cut some zipties holding the tail light wire to the rack.
From the underside remove the hardware for the battery dock and the battery tray. Do the 4 dock bolts first (outlined in red square below) and then lift the dock out of the way.
Remove the 6 bolts circled in yellow below. Use a philips #2 to hold the bolt from the top and use a m8 wrench to turn the nut on the bottom.
Move the tray over to the new rack and install the 6 bolts/nuts. Leave them loose.
Install the dock back onto the rack by setting it in place on top of the battery tray. There are 4 holes that the dock fits into. Install the 4 bolts from the underside of the rack. You can tighten these down all the way.
Go back and tighten the 6 bolts/nuts that hold the tray onto the rack.
Install the rack on the frame.
Plug the power plug into the port on the frame and use the wire coils and zip ties to manage the wiring.
Insert the rear rack battery.