re-add db revision and fix renaming to also change category for files that ended up in the wrong place