Is there a way to search and display all URLs in a Moodle

Is there a way to search and display all URLs in a Moodle

by Cory Antonini -
Number of replies: 3

We have changed video services providers and I need to find all the links to external videos Moodle wide (within in all courses). 

Is there a way to either a) list all links in a Moodle (either system wide or within a course), or b) search all urls by key term "i.e. youtube".?


Thanks!

Average of ratings: -
In reply to Cory Antonini

Re: Is there a way to search and display all URLs in a Moodle

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You should be able to use the Moodle search and replace command line tool.

https://docs.moodle.org/400/en/Search_and_replace_tool

However, it is *vital* that you take a full backup before trying this.
In reply to Howard Miller

Re: Is there a way to search and display all URLs in a Moodle

by Cory Antonini -
Thanks--I saw that option. It unfortuantely it requires I replace the text (each link requires a different link, so doing them in bulk will not work). While it does display the matches, it doesn't show me where the links are in the moodle. The issue is that I have no idea how many links I have to replace, or where they are in the Moodle. I only know that every url that contains "kaltura" needs to be replaced. I was hoping for an easy way to find the location of each "kaltura" link.
Average of ratings:Useful (1)
In reply to Cory Antonini

Re: Is there a way to search and display all URLs in a Moodle

by Mark Sharp -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Links can be all over the place in the Moodle database, you would need to be happy to write a very long and comprehensive SQL query to find them all. The likely places to find the majority are in the following places:
  • mdl_label: intro
  • mdl_page: intro & content
  • mdl_url: externalurl
  • mdl_course: summary
  • mdl_course_sections: summary

Anywhere, there is a intro, summary, description, or any other text area can have a link in the content. But the tables above should give you most.

You don't mention your technical ability, if you're not familiar with SQL I would try to find someone in your org to help. Other than the replace plugin, I'm not aware of anything else that will give you what you want. Unless there's something in the Moodle plugin database https://moodle.org/plugins 

Average of ratings:Useful (2)