Hello,

I am currently running version osTicket v.1.10.4.:

osTicket Version v1.10.4 (035fd0a) — Up to date
Web Server Software Apache
MySQL Version 5.7.24
PHP Version 5.6.38-2+ubuntu16.04.1+deb.sury.org+1

I have built a separate server running osTicket v1.11.0-rc1:

osTicket Version v1.11.0-rc1 (e321982) — Up to date
Web Server Software Apache/2.4.18 (Ubuntu)
MySQL Version 5.7.24
PHP Version 5.6.39-1+ubuntu16.04.1+deb.sury.org+1

I have a bunch of 'Forms' built and need to migrate them to the new osTicket v1.11.0-rc1 server.

I've attempted to migrate the following tables:

  • ost_form
  • ost_form_entry
  • ost_form_field
  • ost_help_topic_form
  • ost_list
  • ost_list_items

After importing those, when I navigate to my osTicket website I get a "Error 500" from the webserver.

I check the logs and am confronted with the following error:

[Wed Jan 23 10:16:20.090339 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP Fatal error:  Class name must be a valid object or a string in /var/www/html/osticket/upload/include/class.forms.php on line 1088, referer: http://ops.nhsocal.com/scp/forms.php?id=15
[Wed Jan 23 10:16:20.090368 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP Stack trace:, referer: http://ops.nhsocal.com/scp/forms.php?id=15
[Wed Jan 23 10:16:20.090377 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP   1. {main}() /var/www/html/osticket/upload/scp/index.php:0, referer: http://ops.nhsocal.com/scp/forms.php?id=15
[Wed Jan 23 10:16:20.090384 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP   2. require() /var/www/html/osticket/upload/scp/index.php:17, referer: http://ops.nhsocal.com/scp/forms.php?id=15
[Wed Jan 23 10:16:20.090391 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP   3. CustomQueue->getQuery() /var/www/html/osticket/upload/scp/tickets.php:531, referer: http://ops.nhsocal.com/scp/forms.php?id=15
[Wed Jan 23 10:16:20.090398 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP   4. CustomQueue->getBasicQuery() /var/www/html/osticket/upload/include/class.queue.php:832, referer: http://ops.nhsocal.com/scp/forms.php?id=15
[Wed Jan 23 10:16:20.090406 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP   5. CustomQueue->mangleQuerySet() /var/www/html/osticket/upload/include/class.queue.php:819, referer: http://ops.nhsocal.com/scp/forms.php?id=15
[Wed Jan 23 10:16:20.090413 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP   6. CustomQueue->getSupportedMatches() /var/www/html/osticket/upload/include/class.queue.php:884, referer: http://ops.nhsocal.com/scp/forms.php?id=15
[Wed Jan 23 10:16:20.090420 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP   7. CustomQueue::getSearchableFields() /var/www/html/osticket/upload/include/class.queue.php:309, referer: http://ops.nhsocal.com/scp/forms.php?id=15
[Wed Jan 23 10:16:20.090428 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP   8. DynamicFormField->getImpl() /var/www/html/osticket/upload/include/class.queue.php:362, referer: http://ops.nhsocal.com/scp/forms.php?id=15
[Wed Jan 23 10:16:20.090435 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP   9. DynamicFormField->__call() /var/www/html/osticket/upload/include/class.queue.php:362, referer: http://ops.nhsocal.com/scp/forms.php?id=15
[Wed Jan 23 10:16:20.090443 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP  10. call_user_func_array:{/var/www/html/osticket/upload/include/class.dynamic_forms.php:600}() /var/www/html/osticket/upload/include/class.dynamic_forms.php:600, referer: http://ops.nhsocal.com/scp/forms.php?id=15
[Wed Jan 23 10:16:20.090450 2019] [:error] [pid 10557] [client 10.2.10.102:57986] PHP  11. FormField->getImpl() /var/www/html/osticket/upload/include/class.dynamic_forms.php:600, referer: http://ops.nhsocal.com/scp/forms.php?id=15

Not sure if this is due to code differences between the versions, or table naming schema differences.

Any help would be appreciated or any tips in importing "Form" related tables into the new database.

The easiest way to make sure that you can migrate is to dump the entire live db to an .sql file.
restore it on the target machine.

Then log into osTicket and run the upgrader. It will make any changes to the database that it needs to make.

    ntozier

    I wasn't aware there was an upgrader, could you point me to that kind sir?

    I found old osTicket 10.6 documentation in regards to that, but I figured it was outdated.

    Is there a newer version / newer documentation?

    The upgrader runs automagically if it is needed. all you have to do is log in.

      ntozier

      So just export the database and import, then login and done?

      Can I do this after the installation of osTicket, or do I do this before installing osTicket?

      Is there a step-by-step I can read?

      Upgrade from v.1.10.4 to v.1.11.0-rc1
      1. Make sure you have a backup of Database and files of osTicket
      2. Then put the system in the offline mode
      3. Upload v. 1.11.0-rc1 and replace current files/folders from Upload folder of your downloaded, and exclude the script folder/files
      4. Copy ost-config.php from current /include folder to osTicket server same location /include, then restore the .sql backup if it's a different server
      5. Make sure you have the correct permission, then go to the URL of the osTicket system and login
      6. Delete the /setup folder and update any customization you may have

      That’s it, note because this upgrade did have database changes so you will see the upgrader screen. Version 1.10.1 to 1.10.4 did NOT have any database change so you will not see upgrade screen

      If you want you can run manually upgrader: /scp/upgrade.php

        ramrajone

        I already have a new server setup with a fresh clean vanilla copy of osTicket v1.11.0-rc1 installed.

        Can I skip step #3 and just import the old database into it?

        Or do I need to wipe it, install osTicket 1.10.4 and then follow the steps above?

        ntozier

        Thanks guys, I attempted the upgrade, it told me "Something went wrong" then it took me to the 'upgrade complete'.

        I tried going to the Admin panel, and got the same HTTP ERROR 500.

        I looked in the logs, and I'm still running into that same error I posted above:

        [Wed Jan 23 12:39:24.240392 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP Fatal error:  Class name must be a valid object or a string in /var/www/html/osticket/upload/include/class.forms.php on line 1088
        [Wed Jan 23 12:39:24.240428 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP Stack trace:
        [Wed Jan 23 12:39:24.240437 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP   1. {main}() /var/www/html/osticket/upload/scp/index.php:0
        [Wed Jan 23 12:39:24.240444 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP   2. require() /var/www/html/osticket/upload/scp/index.php:17
        [Wed Jan 23 12:39:24.240451 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP   3. CustomQueue->getQuery() /var/www/html/osticket/upload/scp/tickets.php:531
        [Wed Jan 23 12:39:24.240458 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP   4. CustomQueue->getBasicQuery() /var/www/html/osticket/upload/include/class.queue.php:832
        [Wed Jan 23 12:39:24.240465 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP   5. CustomQueue->mangleQuerySet() /var/www/html/osticket/upload/include/class.queue.php:819
        [Wed Jan 23 12:39:24.240473 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP   6. CustomQueue->getSupportedMatches() /var/www/html/osticket/upload/include/class.queue.php:884
        [Wed Jan 23 12:39:24.240480 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP   7. CustomQueue::getSearchableFields() /var/www/html/osticket/upload/include/class.queue.php:309
        [Wed Jan 23 12:39:24.240487 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP   8. DynamicFormField->getImpl() /var/www/html/osticket/upload/include/class.queue.php:362
        [Wed Jan 23 12:39:24.240494 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP   9. DynamicFormField->__call() /var/www/html/osticket/upload/include/class.queue.php:362
        [Wed Jan 23 12:39:24.240501 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP  10. call_user_func_array:{/var/www/html/osticket/upload/include/class.dynamic_forms.php:600}() /var/www/html/osticket/upload/include/class.dynamic_forms.php:600
        [Wed Jan 23 12:39:24.240509 2019] [:error] [pid 11896] [client 10.2.10.102:55220] PHP  11. FormField->getImpl() /var/www/html/osticket/upload/include/class.dynamic_forms.php:600
        

          Pietro_Aretino
          Take a look at this link about your error: PHP Fatal error: Class name must be a valid object or a string in

          https://forum.osticket.com/d/89888-resolved-problems-with-upgrade-from-1912-to-110/2

          it seems like PHP or something you have in the custom form that does not like, which version are you running? Can you try 7.0.x?
          PHP Fatal error: Class name must be a valid object or a string in /var/www/html/osticket/upload/include/class.forms.php on line 1088

            ramrajone

            Come to think of it, I did do some customization in the Form tables in the database.

            Damn. I wonder if there's a way if I can import everything but exclude the ost_form tables...

            Thanks ramrajone.

              Pietro_Aretino
              sorry, I am not good at making changes to the database, someone else might help you out, good luck

              So I built a quick shell script that allows me to rebuild the entire database structure, and ignore the data in the tables of the database that I customized. That way the customized tables will not be imported, just their structure; just because the initial errors I was getting were related to the "lists" and "form" related tables in the database, as those were the ones I had customized.

              #!/bin/bash
              PASSWORD="password"
              HOST=localhost
              USER=osticket
              DATABASE=osticket
              DB_FILE=dump.sql
              EXCLUDED_TABLES=(
              ost_form
              ost_form_entry
              ost_form_entry_values
              ost_form_field
              ost_help_topic_form
              ost_list
              ost_list_items
              )
              
              IGNORED_TABLES_STRING=''
              for TABLE in "${EXCLUDED_TABLES[@]}"
              do :
                 IGNORED_TABLES_STRING+=" --ignore-table=${DATABASE}.${TABLE}"
              done
              
              echo "Dump structure"
              mysqldump --host=${HOST} --user=${USER} --password=${PASSWORD} --single-transaction --no-data --routines ${DATABASE} > ${DB_FILE}
              
              echo "Dump content"
              mysqldump --host=${HOST} --user=${USER} --password=${PASSWORD} ${DATABASE} --no-create-info --skip-triggers ${IGNORED_TABLES_STRING} >> ${DB_FILE}
              

              So I did that, exported the database, then uploaded it and now I got different errors:

              PHP Fatal error:  Uncaught exception 'DoesNotExist' in /var/www/html/osticket/upload/include/class.orm.php:1343\nStack trace:\n
              #0 /var/www/html/osticket/upload/include/class.dynamic_forms.php(483): QuerySet->one()\n
              #1 /var/www/html/osticket/upload/include/class.dynamic_forms.php(478): TicketForm::getNewInstance()\n
              #2 /var/www/html/osticket/upload/include/class.ticket.php(2190): TicketForm::getInstance()\n
              #3 /var/www/html/osticket/upload/include/class.queue.php(343): Ticket::getSearchableFields()\n
              #4 /var/www/html/osticket/upload/include/class.queue.php(309): CustomQueue::getSearchableFields('Ticket')\n
              #5 /var/www/html/osticket/upload/include/class.queue.php(884): CustomQueue->getSupportedMatches()\n
              #6 /var/www/html/osticket/upload/include/class.queue.php(819): CustomQueue->mangleQuerySet(Object(QuerySet))\n
              #7 /var/www/html/osticket/upload/include/class.queue.php(832): CustomQueue->getBasicQuery(false)\n
              #8 /var/www/html/osticket/upload/scp/tickets.php(531): CustomQueue->getQuery(false, NULL)\n
              #9 /var/www/html/osticket/upload/scp/index.php in /var/www/html/osticket/upload/include/class.orm.php on line 1343, referer: http://ops.nhsocal.com/scp/upgrade.php?c=4&r=21
              

              Any ideas? What 'DoesNotExist'?

              17 days later

              KevinTheJedi

              Strange. Well at the moment I'm trying to dump everything except the "Form" related tables and use the vanilla structure of those tables. I'll see if that works.

              Write a Reply...