## Installation

### Move/upgrade WW to new server and associated issues

by Chuck Johnson -
Number of replies: 7
I was asked to upgrade our WebWork server over Christmas break from 2.7 to 2.9. There were issues that the previous server had that I thought would be rectified by doing a complete re-install onto a new system. I don't know as though I have seen any documentation on the proper way to do this, so I did what I have done with other systems that rely on a web server and database...

To outline what I did, I backed up the DB on the original server as well as gathered up the important bits of information and files that I needed. I then took the easy way out and used the Vanilla Live DVD since everything was setup and I knew it should work...

I installed the server and software using the Live DVD, I then backed up the DB that shipped with the disk and then restored the DB from the old server, I then copied the files from the old server onto the locations on the new server, made the configuration changes that needed to be made and then looked at the server, upgraded the courses that were now on the server and it seemed to be OK to me. I could create a new course, archive it, unarchive it and do what limited things I knew to try. I then handed it over to the faculty who will be using it to teach and of course they quickly found an issue...

When trying to unarchive an old course, they get the following errors (I have cleaned up the course name, instructor's name as well as the server information from the errors):

Initial error when unarchiving the course. It created the class on the course list. From what I have found, this doesn't appear to be a major issue...

## WeBWorK error

An error occured while processing your request. For help, please send mail to this site's webmaster (), including all of the following information as well as what what you were doing when the error occured.

Wed Dec 24 18:15:59 2014

### Warning messages

• Failed to restore table &#39;Course-Name_achievement_user&#39; with command &#39;2&gt;&amp;1 /usr/bin/mysql --defaults-file=/tmp/1JwkNTxLpI webwork &lt; /opt/webwork/courses/Course-Name/DATA/mysqldump/achievement_user.sql&#39; (exit=2 signal=0 core=0): sh: 1: cannot open /opt/webwork/courses/Course-Name/DATA/mysqldump/achievement_user.sql: No such file<br /><br />Failed to restore table &#39;Course-Name_achievement&#39; with command &#39;2&gt;&amp;1 /usr/bin/mysql --defaults-file=/tmp/HFvb7DuVKa webwork &lt; /opt/webwork/courses/Course-Name/DATA/mysqldump/achievement.sql&#39; (exit=2 signal=0 core=0): sh: 1: cannot open /opt/webwork/courses/Course-Name/DATA/mysqldump/achievement.sql: No such file<br /><br />Failed to restore table &#39;Course-Name_global_user_achievement&#39; with command &#39;2&gt;&amp;1 /usr/bin/mysql --defaults-file=/tmp/hnRtRSC_Fq webwork &lt; /opt/webwork/courses/Course-Name/DATA/mysqldump/global_user_achievement.sql&#39; (exit=2 signal=0 core=0): sh: 1: cannot open /opt/webwork/courses/Course-Name/DATA/mysqldump/global_user_achievement.sql: No such file<br /><br />Failed to restore table &#39;Course-Name_past_answer&#39; with command &#39;2&gt;&amp;1 /usr/bin/mysql --defaults-file=/tmp/HY7dB4AyhV webwork &lt; /opt/webwork/courses/Course-Name/DATA/mysqldump/past_answer.sql&#39; (exit=2 signal=0 core=0): sh: 1: cannot open /opt/webwork/courses/Course-Name/DATA/mysqldump/past_answer.sql: No such file<br /><br />Use of uninitialized value in join or string at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 822.<br />Use of uninitialized value in join or string at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 822.<br />Use of uninitialized value in join or string at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 822.<br />Use of uninitialized value in join or string at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 822.<br />Use of uninitialized value in join or string at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 822.<br />Use of uninitialized value in join or string at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 822.<br />Use of uninitialized value in join or string at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 822.<br />Use of uninitialized value in join or string at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 822.<br />Use of uninitialized value in join or string at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 822.<br />Use of uninitialized value in join or string at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 822.<br />Use of uninitialized value in join or string at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 822.<br />

### Error messages

DBD::mysql::db do failed: Can't find file: './webwork/Instructor@002dMath@002d251@002dSpring@002d2012_global_user_achievement.frm' (errno: 2)
WeBWorK::DB
/opt/webwork/webwork2/lib/WeBWorK/DB.pm
399
WeBWorK::DB::Schema::NewSQL::Std::rename_table
1

1762
UUUUUUUUUUUUUUUU?

WeBWorK::Utils::CourseManagement
/opt/webwork/webwork2/lib/WeBWorK/Utils/CourseManagement.pm
469
WeBWorK::DB::rename_tables
1

1762
UUUUUUUUUUUUUUUU?

WeBWorK::Utils::CourseManagement
/opt/webwork/webwork2/lib/WeBWorK/Utils/CourseManagement.pm
815
WeBWorK::Utils::CourseManagement::renameCourse
1

2018
UUUUUUUUUUUUUUUU?

### Call stack

The information below can help locate the source of the problem.

• in WeBWorK::DB::Schema::NewSQL::Std::handle_error called at line 176 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
• in WeBWorK::DB::Schema::NewSQL::Std::rename_table called at line 399 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
• in WeBWorK::DB::rename_tables called at line 469 of /opt/webwork/webwork2/lib/WeBWorK/Utils/CourseManagement.pm
• in WeBWorK::Utils::CourseManagement::renameCourse called at line 815 of /opt/webwork/webwork2/lib/WeBWorK/Utils/CourseManagement.pm
• in WeBWorK::Utils::CourseManagement::unarchiveCourse called at line 2085 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm
• in WeBWorK::ContentGenerator::CourseAdmin::do_unarchive_course called at line 451 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm
• in WeBWorK::ContentGenerator::CourseAdmin::body called at line 155 of /opt/webwork/webwork2/lib/WeBWorK/Template.pm
• in WeBWorK::Template::template called at line 530 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
• in WeBWorK::ContentGenerator::content called at line 376 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/CourseAdmin.pm
• in WeBWorK::ContentGenerator::CourseAdmin::content called at line 202 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
• in WeBWorK::ContentGenerator::go called at line 370 of /opt/webwork/webwork2/lib/WeBWorK.pm

### Request information

Method

POST

URI

/webwork2/admin/

HTTP Headers

 Connection keep-alive Origin https://... User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 Referer Accept text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Content-Length 1087 Accept-Language en-US,en;q=0.8,es-419;q=0.6,es;q=0.4 Host ... Accept-Encoding gzip, deflate Cache-Control max-age=0 Cookie WeBWorKCourseAuthen.Course-Name=Instructor%09vQzYDDyrSwOFZupK7CMZS29n6bzxHEOP%091419466429; WeBWorKCourseAuthen.admin=Instructor%09QodcFfJc0xwzj8DDzDGyxH3jKzfKMrhx%091419466524; cadataBEBD40997F91429B82D1D996F5A80166="6d7b0f209-fb81-42be-b9b5-861fdcf803cat+lueEoZFHy5Dn7pf5XoEQIcXO/S41TNap4ZZo/IJbMCZKASkMdRkFkbVv78IOZmq8Upt97gX1ELOnY66cMKmeTS8mzAfMBc49Vdsf+AmEt/OZ3wfqrI3Jo6/gXqBh4bVitNkJAoog1KXEWeOeSLLQMXV684hvXJQyTnPeWUEzg="; __utma=16418996.1702620067.1419455583.1419463207.1419463529.3; __utmc=16418996; __utmz=16418996.1419463529.3.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided) Content-Type multipart/form-data; boundary=----WebKitFormBoundaryDmg3jV93bBJVVfru

This is the error the instructor received when attempting to access the course:

## WeBWorK error

An error occured while processing your request. For help, please send mail to this site's webmaster (), including all of the following information as well as what what you were doing when the error occured.

Wed Dec 24 18:17:27 2014

### Call stack

The information below can help locate the source of the problem.

• in Exception::Class::Base::throw called at line 819 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
• in WeBWorK::DB::Schema::NewSQL::Std::handle_error called at line 413 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
• in WeBWorK::DB::Schema::NewSQL::Std::_get_fields_where_prepex called at line 381 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
• in WeBWorK::DB::Schema::NewSQL::Std::get_fields_where called at line 441 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
• in WeBWorK::DB::Schema::NewSQL::Std::get_records_where called at line 741 of /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm
• in WeBWorK::DB::Schema::NewSQL::Std::gets called at line 500 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
• in WeBWorK::DB::getUsers called at line 495 of /opt/webwork/webwork2/lib/WeBWorK/DB.pm
• in WeBWorK::DB::getUser called at line 441 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
• in WeBWorK::Authen::check_user called at line 300 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
• in WeBWorK::Authen::do_verify called at line 217 of /opt/webwork/webwork2/lib/WeBWorK/Authen.pm
• in WeBWorK::Authen::verify called at line 307 of /opt/webwork/webwork2/lib/WeBWorK.pm

### Request information

Method

POST

URI

/webwork2/Course-Name/

HTTP Headers

 Content-Type multipart/form-data; boundary=----WebKitFormBoundaryyR3P01UWLP6BsQ70 Cookie WeBWorKCourseAuthen.Course-Name=Instructor%09vQzYDDyrSwOFZupK7CMZS29n6bzxHEOP%091419466429; WeBWorKCourseAuthen.admin=Instructor%09QodcFfJc0xwzj8DDzDGyxH3jKzfKMrhx%091419466558; cadataBEBD40997F91429B82D1D996F5A80166="6d7b0f209-fb81-42be-b9b5-861fdcf803cat+lueEoZFHy5Dn7pf5XoEQIcXO/S41TNap4ZZo/IJbMCZKASkMdRkFkbVv78IOZmq8Upt97gX1ELOnY66cMKmeTS8mzAfMBc49Vdsf+AmEt/OZ3wfqrI3Jo6/gXqBh4bVitNkJAoog1KXEWeOeSLLQMXV684hvXJQyTnPeWUEzg="; __utma=16418996.1702620067.1419455583.1419463207.1419463529.3; __utmc=16418996; __utmz=16418996.1419463529.3.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided) Accept-Encoding gzip, deflate Cache-Control max-age=0 Host … Referer Accept text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Language en-US,en;q=0.8,es-419;q=0.6,es;q=0.4 Content-Length 249 User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 Connection keep-alive Origin https://...

I don't know if part of the problem is that the restored DB's are from an earlier version or if it is because the course itself was probably archived when we were back on WebWork 2.4/2.5?

Any advice or assistance would be greatly appreciated. If it is an issue that was caused by the way that I "updated" the server, I still have a bit of time that I could take to do an installation the proper way... I could also drop and restore the database and work with the courses from the old server if that is a possibility, it would be even better.

If more information is needed, please let me know and I will get it posted as soon as possible.

Thanks in advance!

Chuck

In reply to Chuck Johnson

### Re: Move/upgrade WW to new server and associated issues

by Danny Glin -
Are you using the "New Name" option when unarchiving a course?  If so, can you try unarchiving without this option checked?
In reply to Danny Glin

### Re: Move/upgrade WW to new server and associated issues

by Arnold Pizer -
Hi,

It may be that the course was unarchived, but the database needs to be upgraded.  You can log into the admin course, select "upgrade courses" and see if the offending course is listed with the notation "Database tables need updating". If so, try upgrading and that should fix the problem.

Arnie
In reply to Arnold Pizer

### Re: Move/upgrade WW to new server and associated issues

by Chuck Johnson -
Hi Arnie,

Thanks for the tip. When I performed the update courses, there were no upgrades to do on that course. It was worth a shot though.

Thanks!

Chuck

In reply to Danny Glin

### Re: Move/upgrade WW to new server and associated issues

by Chuck Johnson -
I am awaiting a response from the faculty person who unarchived the course, I will let you know the results when I hear back. I imagine that she was using the rename function of the unarchive option, but I'm not sure.

Also, I did notice one interesting thing while looking at the database and it's tables, there are extra tables in the database for courses that are not listed as courses (active or inactive) on the server at this time. In trying to figure things out, I unarchived one of the test courses I worked on after the upgrade, renamed it, deleted it etc. and it appears that after deleting the course, the tables are all removed from the database after deleting the course. Could it be that there are extra tables in the database that correspond to the original course that was being unarchived and they need to be dropped?

I believe that if the original courses were unarchived, the appropriate tables would be recreated.

Thanks for your assistance.

Chuck
In reply to Chuck Johnson

### Re: Move/upgrade WW to new server and associated issues

by Danny Glin -
Looking more closely at the text of the error message, I suspect that archiving a course from a version 2.7 or earlier, then unarchiving into a version 2.8 or later is currently broken.

If my suspicion is correct (since I haven't actually checked the code), the course archive does a mysqldump of each course table to a separate file.  The course unarchive then looks for a dump file for each table it tries to create.

Version 2.8 added the achievements feature, which requires additional course tables.  Based on the error message, it looks like the unarchive is looking for dumps of these tables, which won't exist for a dump from a pre-achievements version, and this looks to be causing the whole process to fail.

I believe the Upgrade courses feature in the Admin course will create these tables if they don't exist, but getting to that stage involves successfully recreating the old 2.7 course in the new 2.9 install, which you appear to have done by copying the database and the courses directory from your old server.

If what I've written is correct, then any course archived in 2.7, or in 2.9 before Upgrade course was run will hit this error.  According to what you wrote, you have successfully upgraded all courses to 2.9, so if an instructor archives a course in the current state (i.e. after Upgrade courses was run), they should be able to unarchive it successfully.

Let me know if your experience differs.

Danny
In reply to Danny Glin

### Re: Move/upgrade WW to new server and associated issues

by Chuck Johnson -
When I wrote that the courses were upgraded, I didn't mention that there was an issue with the admin course (I don't know if this is related to the fact that I backed up and dropped the original db from the vanilla install) and then restored the db from the version that was being used previously...

The output that I see when attempting to upgrade that course is:

upgradeReport for course admin:
Database:
• achievement Table is ok
• achievement_user Table is ok
• global_user_achievement Table is ok
• key Table is ok
• password Table is ok
• past_answer Table is ok
• permission Table is ok
• problem Table is ok
• problem_user Schema and database table definitions do not agree
• Field last_answer => is ok
• Field num_incorrect => is ok
• Field num_correct => is ok
• Field attempted => is ok
• Field problem_id => is ok
• Field max_attempts => is ok
• Field value => is ok
• Field source_file => is ok
• Field version_id => missing in schema
• Field set_id => is ok
• Field flags => is ok
• Field problem_seed => is ok
• Field user_id => is ok
• Field status => is ok
• Field sub_status => is ok
• set Table is ok
• set_locations Table is ok
• set_locations_user Table is ok
• set_user Schema and database table definitions do not agree
• Field versions_per_interval => is ok
• Field time_limit_cap => is ok
• Field hide_score_by_problem => is ok
• Field problem_randorder => is ok
• Field problems_per_page => is ok
• Field visible => is ok
• Field version_id => missing in schema
• Field set_id => is ok
• Field restrict_ip => is ok
• Field relax_restrict_ip => is ok
• Field open_date => is ok
• Field description => is ok
• Field hide_score => is ok
• Field due_date => is ok
• Field version_last_attempt_time => is ok
• Field time_interval => is ok
• Field version_time_limit => is ok
• Field restricted_release => is ok
• Field hide_work => is ok
• Field enable_reduced_scoring => is ok
• Field psvn => is ok
• Field assignment_type => is ok
• Field attempts_per_version => is ok
• Field user_id => is ok
• Field hide_hint => is ok
• Field set_header => is ok
• Field version_creation_time => is ok
• Field restricted_login_proctor => is ok
• Field answer_date => is ok
• Field restricted_status => is ok
• Field hardcopy_header => is ok
• setting Table is ok
• user Table is ok

Database tables are ok

There are extra database fields which are not defined in the schema for at least one table. They can only be removed manually from the database.

Directory structure
• DATA => /opt/webwork/courses/admin/DATA rwx
• achievements => /opt/webwork/courses/admin/templates/achievements rwx
• achievements_html => /opt/webwork/courses/admin/html/achievements rwx
• email => /opt/webwork/courses/admin/templates/email rwx
• html => /opt/webwork/courses/admin/html rwx
• html_images => /opt/webwork/courses/admin/html/images rwx
• html_temp => /var/www/html/wwtmp/admin rwx
• logs => /opt/webwork/courses/admin/logs rwx
• macros => /opt/webwork/courses/admin/templates/macros rwx
• mailmerge => /opt/webwork/courses/admin/DATA/mailmerge rwx
• root => /opt/webwork/courses/admin rwx
• scoring => /opt/webwork/courses/admin/scoring rwx
• templates => /opt/webwork/courses/admin/templates rwx
• tmpEditFileDir => /opt/webwork/courses/admin/templates/tmpEdit rwx

Directory structure is ok

## WeBWorK Warnings

WeBWorK has encountered warnings while processing your request. If this occured when viewing a problem, it was likely caused by an error or ambiguity in that problem. Otherwise, it may indicate a problem with the WeBWorK system itself. If you are a student, report these warnings to your professor to have them corrected. If you are a professor, please consult the warning output below for more information.

### Warning messages

• Harmless: admin_set has extra column 'published' for older course.
• Harmless: admin_set_user has extra column 'published' for older course.

### Request information

 Time Wed Jan 07 14:37:36 2015 Method POST URI /webwork2/admin/

The output from after the upgrade button is pressed on the above screen is:

Report for course admin:

Database:

• achievement Table is ok
• achievement_user Table is ok
• global_user_achievement Table is ok
• key Table is ok
• password Table is ok
• past_answer Table is ok
• permission Table is ok
• problem Table is ok
• problem_user Schema and database table definitions do not agree
• Field max_attempts => is ok
• Field set_id => is ok
• Field version_id => missing in schema
• Field source_file => is ok
• Field value => is ok
• Field problem_seed => is ok
• Field flags => is ok
• Field last_answer => is ok
• Field num_incorrect => is ok
• Field attempted => is ok
• Field num_correct => is ok
• Field problem_id => is ok
• Field status => is ok
• Field sub_status => is ok
• Field user_id => is ok
• set Table is ok
• set_locations Table is ok
• set_locations_user Table is ok
• set_user Schema and database table definitions do not agree
• Field psvn => is ok
• Field assignment_type => is ok
• Field version_time_limit => is ok
• Field restricted_release => is ok
• Field hide_work => is ok
• Field enable_reduced_scoring => is ok
• Field set_header => is ok
• Field restricted_status => is ok
• Field answer_date => is ok
• Field version_creation_time => is ok
• Field restricted_login_proctor => is ok
• Field hardcopy_header => is ok
• Field attempts_per_version => is ok
• Field user_id => is ok
• Field hide_hint => is ok
• Field visible => is ok
• Field set_id => is ok
• Field version_id => missing in schema
• Field restrict_ip => is ok
• Field versions_per_interval => is ok
• Field time_limit_cap => is ok
• Field hide_score_by_problem => is ok
• Field problem_randorder => is ok
• Field problems_per_page => is ok
• Field due_date => is ok
• Field description => is ok
• Field hide_score => is ok
• Field version_last_attempt_time => is ok
• Field time_interval => is ok
• Field open_date => is ok
• Field relax_restrict_ip => is ok
• setting Table is ok
• user Table is ok

Database tables are ok

There are extra database fields which are not defined in the schema for at least one table. They can only be removed manually from the database.

Directory structure

• DATA => /opt/webwork/courses/admin/DATA rwx
• achievements => /opt/webwork/courses/admin/templates/achievements rwx
• achievements_html => /opt/webwork/courses/admin/html/achievements rwx
• email => /opt/webwork/courses/admin/templates/email rwx
• html => /opt/webwork/courses/admin/html rwx
• html_images => /opt/webwork/courses/admin/html/images rwx
• html_temp => /var/www/html/wwtmp/admin rwx
• logs => /opt/webwork/courses/admin/logs rwx
• macros => /opt/webwork/courses/admin/templates/macros rwx
• mailmerge => /opt/webwork/courses/admin/DATA/mailmerge rwx
• root => /opt/webwork/courses/admin rwx
• scoring => /opt/webwork/courses/admin/scoring rwx
• templates => /opt/webwork/courses/admin/templates rwx
• tmpEditFileDir => /opt/webwork/courses/admin/templates/tmpEdit rwx

Directory structure is ok

## WeBWorK Warnings

WeBWorK has encountered warnings while processing your request. If this occured when viewing a problem, it was likely caused by an error or ambiguity in that problem. Otherwise, it may indicate a problem with the WeBWorK system itself. If you are a student, report these warnings to your professor to have them corrected. If you are a professor, please consult the warning output below for more information.

### Warning messages

• Harmless: admin_set has extra column 'published' for older course.
• Harmless: admin_set_user has extra column 'published' for older course.
• Harmless: admin_set_user has extra column 'published' for older course.
• Harmless: admin_set has extra column 'published' for older course.
• Harmless: admin_set_user has extra column 'published' for older course.

### Request information

 Time Wed Jan 07 15:11:45 2015 Method POST URI /webwork2/admin/

I thought that this wasn't a serious issue, but maybe it is? There is one course from 2 summers ago that has the same issue, but all other courses show as being OK.

Could it be that the database that was included with the vanilla install needs to be in place?

I will see if I can archive and unarchive a currently upgraded course.Should I delete the course after it is archived successfully?

Sorry about being such a pain.

Thanks,

Chuck
In reply to Chuck Johnson

### Re: Move/upgrade WW to new server and associated issues

by Michael Gage -
The issue with the admin course can be ignored.

At some version in the past a field for version_id was added to the admin course tables.  It has not been used and support for it in the database schema was removed.  That causes the error message, however an extra field in a table does no harm.

If you feel comfortable working with a mysql database directly you can remove the version_id field from those specific tables and that error message will go away.