XWIKI-9091: DW upgrade mode is not taken into acount everywhere
(cherry picked from commit 563b3a9898ee6ed510fea6d951a6deb3881b7bd7)