I have done this many times, and it should be safe provided that proper care is taken.
The external battery must be the same voltage as the original internal battery, normally 12 volts for the smaller units, 24 volts for larger ones, and more than 24 for very large ones.
Remember that the original battery was enclosed within the UPS and not readily touched, therefore the battery terminals MAY NOT be isolated from the line supply. That is a potentialy fatal line voltage shock could be received from the 12 volt battery leads.
Even if testing shows that the battery leads are isolated from the line supply, do not count on this !
UL or equivalent listing sets very strict standards for isolating line voltage from low voltage connections that can be touched, for example on consumer electronics.
These standards DO NOT apply to UPS units with internal batteries, since when used as intended the battery terminals cant be touched.
I would put the external battery in a large plastic crate with the lid secured to protect the terminals form touch.
The cable to the external battery needs for very thick and not too long. Suggest at least one size larger than the internal battery leads.
Fit an external fuse as close as possible to one battery terminal, size this at about 150% of the running current.
Remember that the inverter may only be designed for short term use, limited by the run time of the small internal battery, and may be killed by overheating if run continually at full power.
If extending the run time with an external battery, I would limit the load to less than 50% of the rating.
The external battery will take longer to charge.
I would accept this and not try and connect any other charger.
The powerchute shutdown software should still work to an extent, but dont count on it being accurate, I dont use it.
The UPS in my office is an APC smart UPS, 700 VA and is intended to use an internal battery of 24 volts 7 A/H.
I have fitted an external battery of 200 A/H and it works just fine, and has seen regular use for years.
The load varies but is typicly about 250 watts
desktop PC, flourescent light, desk fan, router, cellphone charger, Moterola radio charger, inkjet printer.
It certainly ran for a 9 hour working day without problems.
At my Mothers home I installed a 3,000VA UPS with a large external battery bank.
That runs basic lighting, fridge, freezer, TV, cordless phone base unit, cellphone charger, and so on on for several days.
The actual load is probably only about 100 watts average, 500 watts maximum.
I selected a 3,000 VA UPS to ensure that it will start the fridege and freezer.
Computer type UPS units are not ideal for starting motors, and as a crude guide the UPS needs to be rated at TEN times the rating of the connected motor load.
200 watt fridge=min 2,000VA UPS.