How long ago was the switch from Oxycodone to Hydrocodone? If it was fairly recent then it sounds like you are going through withdrawals as Oxy is stronger than Hydro. So if it was a fairly decent drop in dosage and strength...this can happen if not tirated slowly enough.
Weight gain itself isn't a usual symptom of opiates. It can certainly be dehydrating as it causes constipation...So that is why it's even more important to make sure you get plenty of water each day as well as lower greatly your salt intake as well as sugar/simple carbs. And yes, proper exercise that is ok'd by your Dr. I walk 1.2 miles every day. As well as yoga/stretching which helps from getting too stiff.
If someone is a lot less active than they used to be before the spinal pain issues then obviously that will cause one to gain weight.
And not trying to be snarky to Oldbookman...but I'm not sure what being 71 has to do with only walking a bit for those days? That is still pretty young (my great aunt passed away at 96 and walked every single day and exercised until at least 94)...
It's actually even more important that those of us with spine issues get good exercise each day so that we don't add to our issues by getting other health problems like high BP, diabetes, high cholesterol, etc.
So as long as our Drs. ok it....then we have to keep moving