It only took Harry one trip upstairs to move everything he owned from the cupboard to this room. (original text)
Harry hoped that he only had to go up the stairs once to move everything he owned from the storage room to the upstairs bedroom. (my bad translation)
I cannot understand how 上がればよかった is working in this sentence. It surely doesn't have anything to do with hoping/wishing. I'm clearly missing something fundamental. Because of this I'm also not sure whether to translate のに at the end of the first clause as 'even though' or 'in order to'.