1. Is it legal, and valid to do so?
According to what you describe, assuming no code changes after the move from educational to commercial, I'd say, yes - might be worth asking in the IDE vendor forums though.
2. Is it valid to build that application through the free or commercial version of the same IDE, or the project has to be re-coded or developed from the start, entirely on the commercial version of the IDE.
If the IDE requires your app to have a license that prevents derivative work from being commercial, then it's illegal, but that's very unlikely. I'd assume it's fine to take any software with educational license (even that you didn't write, assuming no intellectual property issues to it) and create a commercial version of it, unless the educational license (of the university or so) does not allow derivative commercial work.
3. What permissions and licenses should be acquired if there is such plan?
I'd say confirm (from the university/institute), even if you are the one who developed the software in education, whether the derivative commercial work is allowed, and ensure to have an IDE license that allows commercial work for the coming work of the software (likely you cannot ship it as-is, maybe the institute will permit you though -in writing-).
4. What are the other things too look for in this regard?
As mentioned above, official approval from the institute (just the professor who has been mentoring the project should be enough, better in writing), and a license for future development. Also, for all components that may have been used in the app (libraries, etc..), ensure they have commercial friendly licensing or obtain one.
5. If there is such plan, how to prepare for it at the start of the project, like who to talk to and how to talk about it, what paperwork etc. should be done so that in the end, there is nothing illegal.
I think an official letter from the univ/institute that clearly treats the app as educational before the date of the letter should be the most important step. Also obtaining a commerical license going forward for all app dependencies (including IDE). Basically the idea is you try to act as if you were other person picking the software from the univ/institute not the same who developed it (but not claim you actually are, but try to act equal to that). And of course remove the educational version from any involved computer.