This paper presents a new approach for solving the rearrangement of the unbalanced distribution network. Objectives such as reducing power losses, improving the voltage profile and increasing the voltage stability index of the system are also pursued in this article. In the other part of this paper, we have rearranged the distribution network by using the optimal location of dispersed production units. Harmony search algorithm is used to achieve these goals simultaneously, as well as the optimal location of distribution generation units in the distribution network. Performing a rearrangement in the presence of optimal distribution generation units positions leads to far better results. A fast load distribution technique called the bus injection to branch current and branch current to bus voltage has been used to perform online rearrangement. In solving the stated target functions, the voltage constraints, line flow capacity and the radial limitation of the distribution network are also considered. Then, separately, we explain the target functions described in the article. The proposed method on the standard system is IEEE 25-Bass test which is done in two scenarios including: (1) rearrangement of unbalanced distribution network without the presence of distribution generation units, (2) rearrangement of unbalanced distribution in the presence of distribution generation units. The results obtained at each scenario of simulation were compared with each other and with the results obtained before the rearrangement. Finally, the best and most effective results are presented. Simulation is done using MATLAB software.