Bulk or Batch Updating URLs included throughout Canvas

Jump to solution
rsauls
Community Member

I am looking to batch update 1000s of URLs throughout Canvas, but I am not finding a process for this type of update.  Any advice?  The URL's may have been added in Canvas in a variety of areas and in a variety of ways.  Needing to find and replace pattern within the URL- i.e wanting to change abc.com/example to xyz.com/example.

0 Likes
2 Solutions
robotcars
Community Champion

Hi,

I do not have any code to share on this at the moment, and each use case depends on what you have to target. I can provide some guidance for the most efficient way I've figured out how to do this. Since there is no 'content search' in Canvas, the best place to get a current state of key content and descriptions of content in Canvas is through Canvas Data.

If you have Wiki Pages to update, you can consume https://portal.inshosteddata.com/docs#wiki_page_dim into a Db. Do a query for your string, which would return you the course and the wiki page id.

In your code, you would grab that content, replace the necessary string/url, then update the page with the API and repeat for all items found. https://canvas.instructure.com/doc/api/pages.html#method.wiki_pages_api.update

 

This can be repeated for Quiz, Discussions, Assignments

View solution in original post

dgrobani
Community Champion

I've written a Python script to do this for Canvas pages. It gets each course in one or more subaccounts, gets each wiki page in the course, does a search and replace on the page content, and if the content changes, writes the page content back.

Unfortunately, you'd need to have experience running Python scripts against the Canvas API for it to help you.

View solution in original post