Praise be to Allah.
There is nothing wrong with the form of lending mentioned in the question. It is permissible for a person to pay off a loan that he owes to a particular person or institution with another loan that he takes from another source. This is not regarded as the type of secondary loan that is forbidden, in which the financer or lender of the second loan is the same as the one to whom the first loan is owed. This has been discussed previously in the answer to question no. 149437; q.v. for further information.
After that there is nothing wrong with you taking a new loan from the bank to make use of it or to pay off the debts that you owe, so long as the conditions of the loan are in accordance with Islamic teachings and are permissible.
And Allah knows best.