As my calculations show (roughly) for a 8 KW motor your battery has to deliver at least 8 KW for two seconds. So at 8 KW a 12V battery has to deliver 8000/12 ~ 660 A, which is a LARGE value. Also your transformer will need to step the voltage up to 230 V, so this has to be large and tailored made - very expensive!
You do not say how often this two second running is going to occur - once a minute? or once a month?
The way I would do it, its the cheapest BUT it is extremely dangerous. Get 31 12V batteries. this will give you 372V DC. Now with electronics you can synthesize a half sine wave of 230V RMS, which you apply to one side of the motor, the other going to the battery return. Then electronically you switch over the terminals of the motor and re-apply your half sine wave, so the motor sees half sinewaves being applied to one terminal then the other so the motor is fooled into thinking its getting an ordinary 230V sine wave. No transformer, the semi conductors only have to handle the motors 30A, A 370V battery charger will be required , but as the insulation and security devices must be of the highest order for this circuit, this could be done directly from the mains at minimal cost.
Frank