Upgrading WeBWorK from 2.15 to 2.16

From WeBWorK_wiki
Revision as of 18:47, 14 July 2021 by Dglin (talk | contribs) (First half of page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Under Construction These instructions are intended to help you upgrade from WeBWorK 2.15 to 2.16. This assumes that you have an existing WeBWorK 2.15 system and want to maintain all of your courses and student data.

Upgrading from 2.14 or earlier

If you are upgrading from a version 2.14 or earlier, you will have to modify your database so that it uses the utf8mb4 character set. There are two approaches:

  1. Run the /opt/webwork/bin/upgrade-database-to-utf8mb4.pl script. This script was only added in WeBWorK 2.16, so you will need to check out the WeBWorK 2.16 code (see below) in order for the script to be available, or
  2. Follow the instructions at Converting the webwork database from the latin1 to the utf8mb4 character set

Upgrading from 2.15

Prerequisites

WeBWorK 2.16 requires several new packages

  • npm
    • Ubuntu: sudo apt install npm
    • CentOS/RHEL: sudo yum install npm
  • HTTP::Async
    • Ubuntu: sudo apt install libhttp-async-perl
    • CentOS/RHEL: sudo cpanm HTTP::Async
  • CGI::Cookie
    • Ubuntu 20.04: sudo apt install libcgi-pm-perl
    • CentOS/RHEL and older Ubuntu: sudo cpanm CGI::Cookie
  • Archive::Zip
    • Ubuntu: sudo apt install libarchive-zip-perl
    • CentOS/RHEL: sudo yum install perl-Archive-Zip
  • It is strongly recommended that you switch from DBD::mysql to DBD::MariaDB, so you should install DBD::MariaDB
    • Ubuntu: sudo apt install libdbd-mariadb-perl
    • CentOS/RHEL:
      • You will probably need to install the mariadb-devel package first: sudo yum install mariadb-devel
      • sudo cpanm DBD::MariaDB
  • SQL::Abstract::Classic - WeBWorK is currently not compatible with versions of SQL::Abstract beyond 1.87. You can check your version of SQL::Abstract with the following command:

perl -MSQL::Abstract -e 'print $SQL::Abstract::Version ."\n";' If this reports a version >1.87, then you should install SQL::Abstract::Classic:

    • Ubuntu and CentOS/RHEL: cpanm SQL::Abstract::Classic
  • dvisvgm (required if you wish to use TikZ images in PG problems)
    • Ubuntu: sudo apt install dvisvgm
    • CentOS/RHEL: sudo yum install divsvgm
  • pdf2svg (required if you wish to use TikZ images in PG problems)
    • Ubuntu: sudo apt install pdf2svg
    • CentOS/RHEL: Not currently packaged
  • ImageMagick (required if you wish to use TikZ images in PG problems)
    • Ubuntu: sudo apt install imagemagick
    • CentOS/RHEL: sudo yum install imagemagick


Configuration Files

There have been significant changes to the configuration files (site.conf and localOverrides.conf.dist). It is strongly recommended that you create new copies of the configuration files from the distribution versions, and recreate any custom settings that you have added. Before you check out the new WeBWorK software, make a note of any changes you have made to these two files:

 cd /opt/webwork/webwork2/conf
 diff site.conf site.conf.dist
 diff localOverrides.conf localOverrides.conf.dist

This will tell you what settings you have customized in the config files. Make a note of these so that they can be recreated in the new version.

Downloading the new version

As of 2.16, the default branch of the webwork2 and pg repositories

Gotchas

MariaDB vs. mysql

WeBWorK currently supports recent versions of either MariaDB or mysql as the database server, but the majority of development is being done with MariaDB as the database server, so in the future MariaDB may be better supported. If you choose to migrate from mysql to MariaDB, beware that Ubuntu systems do not automatically delete the AppArmor profile for mysql when you remove mysql and replace it with MariaDB. See https://stackoverflow.com/questions/40997257/mysql-service-fails-to-start-hangs-up-timeout-ubuntu-mariadb for details on how to fix this.