I know this thread is from over a year ago, but i'm replying here as it seems the most relevant place to put it.
A friend of mine damaged his connector beyond repair a few weeks ago. Motor out of warranty. Shimano wanted £900 for a new motor, local shop 'could get one' for £600. Official stance was there are no user serviceable parts inside so the unit is a write off. A ridiculous concept for the sake of a crap plastic connector that's prone to breakage.
Anyway. I removed the connector from the motor housing and replaced it with a 200mm flying lead. This was made up of an M12 gland glued to the connector plate with Raychem S1125 (check whatever glue you use will glue nylon). I then extended the existing wires with 14AWG silicone cable and some 26AWG stranded twisted pair, stolen from a CAT5 patch lead. I used an XT30 and 2 pin JST for the mating halves. Obviously you'll need to replace the damaged half from the battery mount as well. Protect the new flying lead with whatever you have. I used nylon basket weave but any flexible sleeving will do.
Because the RC connectors I had to hand aren't waterproof I coated the internals with dielectric grease and wrapped the whole lot in self amalgamating tape, then sealed the centre of the gland with more S1125. The soldered connections are inside the motor housing.
If you're soldering skills aren't up to scratch then this is a very tricky repair as there isn't much room to play with when soldering the 14AWG near the motor housing. Also worth pointing out is the COM wire colours DO NOT tie up.
YL->BU
BU->WT
This repair worked and my friend owes me beer
I tried to find a suitable replacement connector and had no luck whatsoever. There are some MIL spec connectors that will do the job but they are prohibitively expensive. There are several generic plastic connectors available that can be bought with 2+2 pins but again, they have large minimum orders, are hard to get hold of, or are too bulky. Sorry about the lack of photos, I started and before I knew it I'd finished!