Fix bug in upgrade test

oldID is converted to a string, which is different to the the bytes
version stored in the document.