$CFG->dataroot = 'modledata';
is certainly wrong. It should be a full path like your $CFG->dirroot .
Installing and upgrading help
data directory
This discussion has been locked so you can no longer reply to it.