General developer forum

Migration of moodle site generate admin permission issues

 
Picture of Mohammad Hallak
Migration of moodle site generate admin permission issues
 

Greetings,


We have a Moodle 3.4 site hosted on Siteground. We have created new site in Siteground and copied the root and data file into the new directories, and backed up the database and imported it into the new site.

Everything in the migration process goes well; However, When accessing the new Site with admin user, we have noticed that the admin is not able to add new activity on a course (existing course) and also can not edit the settings of the course.


Please advise!

Regards,




 
Average of ratings: -
Picture of Ken Task
Re: Migration of moodle site generate admin permission issues
Particularly helpful Moodlers

After the clone was up, did you run search and replace on the DB to replace directory in the URL?   Assuming old site was https://site/directory1/ and the new site is https://site/newdirectory/

The search and replace tool is somewhat hidden and you'll have to get to that via direct URL after logging on as an Admin level user.

Go to: 

https://[yoursite/directory]/admin/tool/replace/

** note the warning on that screen ... advise making a backup of your database before using search/replace tool.

Also, might be another issue, so to see what's going on, turn on Debugging via direct URL:

https://[yoursite/directory]/admin/settings.php?section=debugging

Select 'Developer' level and show debugging checked.

If something is reported, copy the text seen to a text file on your local computer, then come back here to post.

Once you've done that, best to turn off debugging - go to same url above to turn it off and un-check show debugging.

'spirit of sharing', Ken



 
Average of ratings: -
Picture of Mohammad Hallak
Re: Migration of moodle site generate admin permission issues
 

Hey Ken, sorry for my late response

I already tried the search and replace tool but nothing seems to be working.

I also turned on debugging mode and it displayed this:


%3Cdiv%20class=pix_url is deprecated. Use image_url for images and pix_icon for icons.
  • line 267 of /lib/outputrenderers.php: call to debugging()
  • line 112 of /theme/lambda/layout/includes/header.php: call to renderer_base->pix_url()
  • line 61 of /theme/lambda/layout/columns2.php: call to require_once()
  • line 1261 of /lib/outputrenderers.php: call to include()
  • line 1191 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 116 of /admin/settings.php: call to core_renderer->header()
https://mymoodle-site/theme/image.php/lambda/theme/1523453860/bg/lambda-shadow" class="lambda-shadow" alt="">
Cheers,
 
Average of ratings: -
Picture of Ken Task
Re: Migration of moodle site generate admin permission issues
Particularly helpful Moodlers

Debug is telling you that the theme Lambda is not compatible with the version of Moodle you are running ... 'depreciated' line.

In order to change one needs to get to admin areas which at present you cannot.  So, suggest setting the theme via config.php file.

Add this line ... not to the bottom below the comment at the end of that file, but above that ...

$CFG->theme="clean";

That sets the theme to a stock/comes with your version of Moodle theme - ie, one compatible.

No need to restart anything, just access the site as normal, login, and see if you can get to the admin areas.   Check notifications to see if your site says there are updates to plugins ... one of which, should be the theme Lambda.

'spirit of sharing', Ken


 
Average of ratings: -
Picture of Mohammad Hallak
Re: Migration of moodle site generate admin permission issues
 

Dear Ken,

I have tried the solution that you suggested with no luck. I have added $CFG->theme="clean"; to the config.php file and the problem remained the same. Only the Lambda theme vanished that was the only change.

Also I have checked the notifications and there are no updates at the mean time.

Any idea what could be causing this problem?

Thanks a lot for your time and help.

 
Average of ratings: -
Picture of Ken Task
Re: Migration of moodle site generate admin permission issues
Particularly helpful Moodlers

Uhhh ... please don't continue to ask if I knew what was causing the problem!!!   No, I don't ... but am trying to help you discover what the problem is so you can fix it. ;)

So the problem is still can;'t get to any admin area ... right?   Let's leave debugging on as you might have found tip of an iceburg and there is yet other stuff that's not compat with 3.4 we've not discovered yet.

So let's review ... did the search and replace thing ... in-compat theme 'disappeared' (am wondering if it really did or not) ... so what's left is to get nasty ...

Not normally the first thing one would recommend but ...  there is a table: mdl_config_plugins that contains the meta data for things like Lambda theme ... and including the theme actually exist.   Is there 'lambda' folder in moodlecode/themes/  ... if so delete it.

Now the table ... can't tell you who lambda configs would be listed as in mdl_config_plugins, but since the folder is gone and the error you got said depreciated code ... we now need to eradicate any reference to that theme in mdl_config_plugins.

Use phpmyadmin for that ... enables you to see before you delete rows.

Then ... more nasty ...

In moodledata/cache/ remove all files folders.

in moodledata/localcache/ remove all files folders.

Clear your browser cache and cookies.

Did that do it?

'spirit of sharing', Ken


 
Average of ratings: -