A quick rough fix would be to solder directly to the PCB pads were the connector was butchered off. Are the compass wires brown red yellow and grey? Connection should be serial data, +5V, not connected, GND and serial clock (clock on right looking from board edge). Clock and data grey and brown, ground = yellow.