DS had a major food aversion from 10 months after a bad go of croup. He's still not great (at 4) but eats a decent variety of nutritious foods.
Which end of 2 years old is he? And is it brand new 3 weeks ago? If so, the following advice (except the milk bit) may be for further down the track. You have to give him more than a few weeks to get over a big life change, I think.
Here's what worked for us:
Watering down bottles. He was mainly having milk when he woke hungry at night. We watered down the bottle/cup of milk so that his stomach felt full enough to get to sleep, but he wasn't getting all his calories from milk. Each night we'd up the water content a little more so that it was gradual, not sudden. You may have some bad nights but in the long run it's worth it - there is no incentive for him to eat if he's getting enough calories from milk.
It's a long term thing, and a control thing - so don't battle him. He'll dig his heels in.
Leave healthy snacks lying around so that he can eat them without the rigmarole of a 'mealtime', and without a parent looming over him.
I did what all the books say not to do and used both TV and pudding as rewards. It doesn't seem to have done long-term harm. He was stressed by having food in front of him and nothing else to focus on - TV helped him to have another focus for a bit. We don't use it often now.
Pudding was similar - very calm and breezy approach. 'That's fine, you don't have to eat it, but remember there's no pudding unless you've eaten x amount'. Sometimes still use that one. You may need to call his bluff once or twice (DS was a bit shocked once when DH and I calmly went and got our pudding and started eating it.)
Reading this back I sound like a terrible parent. But I don't think people realise how difficult severe eating issues can be to overcome.
Honestly - if it's only been happening for three weeks, particularly after a major change in his life, it may be just a blip. It probably is, and you getting worked up about it isn't going to solve it. You need to be consistent in your approach, and act like you're not really that fussed. Praise for eating healthy foods or trying new things, and be neutral when he doesn't eat. He won't starve.
There were long periods when DS was one and two where I'd have been over the moon at a spoonful of rice. 