You would like to transfer employees from one of the departments to another department as this department has become redundant. Nevertheless, your company does not wish to terminate their services. Kudos to the generosity shown towards them!
The transferred employees may not be skilled enough to work in another department. For this your company generous again to train them. After giving these many opportunities, if some employee fails to meet the desired level of performance then obviously he/she deserves to be terminated. There is no need to feel guilty about it.
Your next concern is about possible dispute that could arise because of the salary differences or party with the outsiders. But then the employees working in the original department need to be convinced that those who joined them later or "outsiders", their previous services cannot be ignored.
Give them special training and help to fit in the new department.
Staff will have to adjust to changing business dynamics and changed situations.
Those who voluntarily wish to leave can be permitted to exit.
Finally the business has to run asa going concern profitably for people to get their pay.
Be fair and transparent in tackling the issue.