Electrification in urban transportation is becoming more popular, beside it is also becoming a necessity due to climate changes and sustainability issues. Trolleybuses are presenting an alternative for this purpose. Although their technology is a mature technology that has been used for decades, there are still some technical problems that need to be overcome. In this study, a technical method is presented for the conversion of trolleybus auxiliary power units. The electrification conversion demanded by the metropolitan public transportation company operating 22 trolleybuses in the province of Malatya is the replacement of diesel generators, used as auxiliary power units, with battery units capable of meeting the local operational requirements. For this purpose, a method is proposed and followed. At first step of the implementation, real-time data has gathered from a trolleybus and this one round tour data is used to run on a scaled experiment. The setup has prepared as hardware and software to simulate the consumption on a scaled battery pack. Experimental results were interpreted with capacity and voltage restrictions resulting the determination of battery chemistry and casing to be used. Then optimal battery placement was defined as a container loading problem and application was made with the first fit decreasing algorithm considering mass and volume restrictions. It was found that only two packing types out of six combinations is enough to form a battery pack within the mass and volumetric limitations. It is evaluated that the method adopted in this study can be used in conversion applications to be made in the future.