Hi, Meir.
I believe that's Mustafa's point - you have to run the upgrade script while inside container of the Gluu Server instance you try to upgrade. [This article](https://gluu.org/docs/gluu-server/4.0/upgrade/#upgrading-from-31x-to-40) outlines the procedure.