Yes, that's the basic process. You will pass immigration, leave the airport, and start from scratch travel-wise. Terminal 5 is remarkably far from terminal 2. Walking is not practical. If the flights were on the same ticket then you'd be able to use the transfer shuttles, but landside your best option is the train or underground, of which the underground is easier and more frequent. You can use an Oyster card or contactless credit card to enter and exit (you will not be charged).