This is a question of risk management. I assume when you fix the bug first, you will also release a new version of the application before the migration is completed (otherwise the whole question would be pointless).
Based on this assumption, ask yourself:
- What is the nature of the bug, and what will it mean to your users when you leave it in the application for the time of migration?
When the bug only causes a little bit of inconvenience, easy to work around, then leave it in. If the bug has a high risk of making some of your application's core features fully unusable, with no way for the user to get around it, better fix it ASAP. And as with every bug, you need to think about how much effort it will be to fix it, and how you see the risk of adding further issues in case the fix requires a complex change of the code.
So to make a decision, you have to look at this from your user's point of view and make an assessment. Be aware your application will surely contain a lot of more bugs - surely not each of them is worth to be fixed immediately. And in case a bug was in the application for several months or years, without anyone complaining about it, it rarely requires an urgent fix.