I have recently upgraded (reinstalled) a WeBWorK installation for my old high school to 2.4-dev using CVS from a version that I forgot to check before reformatting (it had DvipngDepths database, if that helps...). I exported the webwork database and courses folder from the old installation and installed it to the new installation and WeBWorK seemed to have no problems reading them (I executed wwdb_upgrade for good measure), but we haven't done much other than log in.
There is one thing that we want to do differently with this installation than with the previous one: namely, use our own custom problem files. What is the recommended way to do this? In our old installation, we had two symbolic links in each course folder (Library and Local) that both pointed to /opt/ProblemLibrary. The reason for Local and Library being identical was that we had some set definition files from ASU that used Local instead of Library, and we didn't want to change the Local link to Library back then (so we 'shortcutted'). If I'm correct in my assumption that we upload custom problem files to Local, then that means that I'll have to change all of the problem urls in each course from Local/something/something to Library/something/something. If we didn't want to use our own custom files, then I could have linked /opt/ProblemLibrary to /opt/webwork/libraries/database_problems (or whatever the NPL name is) and not worry about it. But since we do, I have to "fix" these issues (and it's also less to fix in the future).
The best solution that I see is to write a script that fixes all possible "Local" problems, which includes symlinks, def files, and the mysql database (afaik), which thus frees the Local symlink for local problem libraries:
for each course
changes Library symlink to /opt/webwork/libraries/ProblemLibrary, which points to database_problems
change Local to (1)
change Local to (1)
for each def file
change all instances of Local to Library
for all assignments (in mysql database)
change all problem URL instances of Local to Library (2)
I have a few questions in this script:
1) Where should Local point to (that holds our custom problems)?
2) What tables should I be editing in the webwork database?
I'm not so experienced with bash scripts, so I'm reading up on loops, sed, mysql etc. I also am going to test this not-yet-written script on my laptop first (from the backups) before running on the live server. Is this the best solution for our problem? TIA.