semi working upgrade queries