Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

LimeSurvey 7: Updating an existing database failed

More
3 months 3 weeks ago #273706 by riqcles
Please help us help you and fill where relevant:
LimeSurvey version: LimeSurvey Community Edition [url=https://192.168.56.113/limesurvey7/index.php/admin/databaseupdate/sa/db#modalSystemInformation] Version 7.0.0-beta1+260121 [/url]]
Own server:
Survey theme/template: vanilla
==================

I tested updating my LimeSurvey installation (in a VM).

I got an error (see end of message).

I tried again, installing a clean version 6.15.22.

I imported 4 questionnaires, then installed version 7.

No problem updating the database.

So, the problem seems to be with one or more of my questionnaires, but I have over 3,000.

Debugging enabled or disabled makes no difference. There's nothing in the Postgres logs.

I disabled the update in the config.ini file, to no avail.

I might be an isolated case, so if others are experiencing this, we could report the bug.

P.S.: The release_notes.txt file for version 6.16.5 is empty.

P.S. 2: Should we add a section dedicated to version 7 to the bug tracker?

Error message:

///////////////////////////////////////////

Update pgsql:host=serveurBdd;port=5432;user=limesurvey7;password=limesurvey7;dbname=limesurvey7; with prefix :lime_ from 640 to 700
PHP Error[2]: Undefined array key 0 
in file /var/www/html/limesurvey7/application/helpers/common_helper.php at line 1425
#0 /var/www/html/limesurvey7/vendor/yiisoft/yii/framework/base/CApplication.php(832): CErrorHandler->handle()
#1 /var/www/html/limesurvey7/application/helpers/common_helper.php(1425): ConsoleApplication->handleError()
#2 /var/www/html/limesurvey7/application/helpers/update/updates/Update_700.php(1074): getFieldName()
#3 /var/www/html/limesurvey7/application/helpers/update/DatabaseUpdateBase.php(47): LimeSurvey\Helpers\Update\Update_700->up()
#4 /var/www/html/limesurvey7/application/helpers/update/updatedb_helper.php(88): LimeSurvey\Helpers\Update\Update_700->safeUp()
#5 /var/www/html/limesurvey7/application/commands/UpdateDbCommand.php(46): db_upgrade_all()
#6 /var/www/html/limesurvey7/vendor/yiisoft/yii/framework/console/CConsoleCommandRunner.php(71): UpdateDBCommand->run()
#7 /var/www/html/limesurvey7/vendor/yiisoft/yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#8 /var/www/html/limesurvey7/vendor/yiisoft/yii/framework/base/CApplication.php(185): ConsoleApplication->processRequest()
#9 /var/www/html/limesurvey7/application/commands/console.php(77): ConsoleApplication->run()
[root@serveurIntranet config]#

/////////////////////////////////////////

Your system configuration: 
LimeSurvey version : 251103
Operating system
Linux Intranet server 5.14.0-611.16.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Dec 22 12:21:56 UTC 2025 x86_64
PHP version 8.2.30
Web Server Name 192.168.56.113
Web Server Software Apache/2.4.62 (Rocky Linux) OpenSSL/3.5.1
Web Server Information Database Driver pgsql
Database Connector Version 17.7
Database Server Information PID: 2314; Client Encoding: UTF8; Is Superuser: on; Session Authorization: postgres; Date Style: ISO, MDY
Database Server Version 17.7

////////////////////////////////////////////////

 

LimeSurvey version 6.15.x6
OS : RockyLinux / PHP 8.2.X
BDD : PostGresql 17.x /

Future LimeSurvey version 6.17.x
OS : RockyLinux / PHP 8.4.X
BDD : PostGresql 17.x /
The following user(s) said Thank You: hellencharless

Please Log in to join the conversation.

More
3 months 3 days ago #273877 by riqcles
Good evening,
is no one else experiencing a similar problem?
Has anyone tested migrating an existing PostgreSQL database from version 6 to version 7?
If a test has been performed, was it with a large number of existing questionnaires?
Because I still can't identify which questionnaire(s) might be preventing the database update.

LimeSurvey version 6.15.x6
OS : RockyLinux / PHP 8.2.X
BDD : PostGresql 17.x /

Future LimeSurvey version 6.17.x
OS : RockyLinux / PHP 8.4.X
BDD : PostGresql 17.x /

Please Log in to join the conversation.

More
1 week 3 days ago #274348 by Mazi
Hi there,
we are not using PostGresql so we can not help much. It looks like your issue is related to a certain survey only and with a smaller database with less surveys everything is running fine?
Could this also be a timeout issue during the DB updtae leading to the error or can you safely reproduce this?

In any way, we do NOT recommend to update to version 7 of Limesurvey yet. The reasons are outlined at survey-consulting.com/limesurvey-7-migration/

We will update that overview from time to time and will add further details.
I will also post an update here if one of our customers is facing similar issues with PostGresql.

Best regards/Beste Grüße,
Dr. Marcel Minke
survey-consulting.com
offlinesurveys.com
Feel free to contact me by email for professional LimeSurvey support!

Please Log in to join the conversation.

More
1 week 1 day ago #274361 by DenisChenu
Hi,

Issue : 
  1. With a lot of surveys , updating to 7/X take a long, long time, then update via www can not be done
  2. Update via CLI : error are not shown , just broke and didn't shown the exact SQL error : must be fixed
I think you already reported #1 ? I think we lmust fid nimprovment here.
About 2 : www.limesurvey.org/manual/Optional_settings/en#Logging_settings inside component array.

#2 must be reported too. But  PHP Error[2]: Undefined array key 0 happen only if E_NOTICE is set in error. You can disable it in your php.ini for CLI.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

More
1 week 22 hours ago #274363 by riqcles
No, I didn't report that problem, but another one concerning data integrity with a large database:

forums.limesurvey.org/forum/french-forum...de-nombreuses-tables
I had put it aside while manually cleaning up the oldest questionnaires.

But it's still relevant.

The submitted bug is: bugs.limesurvey.org/view.php?id=12393
almost 10 years old :)

Regarding problem 2:
In production, I have E_ALL & ~E_DEPRECATED. I don't think I can disable E_NOTICE (but we'll try).
For development, I made the change in my php.ini file, but the problem persists. In CLI mode, the script runs and then stops after about 3 minutes with the same error.

I will submit a bug report.

LimeSurvey version 6.15.x6
OS : RockyLinux / PHP 8.2.X
BDD : PostGresql 17.x /

Future LimeSurvey version 6.17.x
OS : RockyLinux / PHP 8.4.X
BDD : PostGresql 17.x /

Please Log in to join the conversation.

More
1 week 22 hours ago #274364 by DenisChenu
Can you check 
Code:
php --ini
to be sure to update the good php.ini ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

More
1 week 22 hours ago #274365 by riqcles

LimeSurvey version 6.15.x6
OS : RockyLinux / PHP 8.2.X
BDD : PostGresql 17.x /

Future LimeSurvey version 6.17.x
OS : RockyLinux / PHP 8.4.X
BDD : PostGresql 17.x /

Please Log in to join the conversation.

More
6 days 18 hours ago #274373 by riqcles
Sorry i'm late :)

I modified my configuration to rerun the tests:
Still using Rocky 9.7, but I'm switching to:

PHP 8.4.21 (cli) (built: May 5 2026 16:34:12) (NTS gcc x86_64)

limesurvey7.0.0-RC1+260430

I'm increasing the file server memory from 2 GB to 16 GB.

(The database server remains at 2 GB and Postgres 17.7.)

I'm removing php-fpm to be as close as possible to my environments.

I modify the php.ini file by adding:

max_input_time = 300
memory_limit = 2048 M
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE

I enable 'debug'=>2 in the config file.

And I rerun the update via the command line.

Now the log file in runtime directory is ok :)

LimeSurvey version 6.15.x6
OS : RockyLinux / PHP 8.2.X
BDD : PostGresql 17.x /

Future LimeSurvey version 6.17.x
OS : RockyLinux / PHP 8.4.X
BDD : PostGresql 17.x /

Please Log in to join the conversation.

More
1 hour 23 minutes ago #274411 by riqcles
Hello,
here's the continuation of the tests:

1. I downloaded the new version 7.0, available on limesurvey.org: limesurvey7.0.0+260526.zip

2. I used SQL scripts to delete all my OLD tables in the database (OLD_limesurvey and OLD_timings): I did not delete the OLD tables from the responses.

3. I reran the data integrity test through the application: this time, I received a message allowing me to delete the OLD tables that are no longer in use.

4. I performed an initial validation of this deletion, then reran the test, which indicated that there were still tables to delete.

5. I did not delete these tables and I reran the update using the command-line script.

6. Error message at the end of the script; I'm checking the generated log file.

7. Still this error message: [system.db.CDbCommand] CDbCommand::execute() failed: SQLSTATE[42601]: Syntax error: 7 ERROR: zero-length delimited identifier at or near """"
LINE 36: "" character varying(5),

^. The SQL statement executed was: CREATE TABLE lime_old_responses_114533_20210205114609

8. I rerun the integrity test and delete the remaining tables.
9. I rerun the script from the command line.
10. Error message at the end: I check the log file:
2026/05/26 15:36:39 [error] [system.db.CDbCommand] CDbCommand::execute() failed: SQLSTATE[53200]: Out of memory: 7 ERROR: out of shared memory
HINT: You might need to increase "max_locks_per_transaction".. The SQL statement executed was: DROP TABLE lime_old_survey_391629_20211019181545.

11. I modify my database server: increase to 4 GB of RAM, modification of the file by changing the value to 2048 MB and I restart the server.
12. I restart the script on the command line.
13. New error message:

2026/05/26 16:33:11 [error] [system.db.CDbCommand] CDbCommand::execute() failed: SQLSTATE[42704]: Undefined object: 7 ERROR: index "lime_idx2_users" does not exist. The SQL statement executed was: DROP INDEX "lime_idx2_users".
2026/05/26 16:33:11 [error] [system.db.CDbCommand] CDbCommand::execute() failed: SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current transaction is aborted, commands ignored until end of transaction block. The SQL statement executed was: CREATE UNIQUE INDEX "lime_idx2_users" ON "lime_users" ("email").
2026/05/26 16:33:59 [error] [exception.CException] CException: Please fix this error in your database and try again in /var/www/html/limesurvey7/application/commands/UpdateDbCommand.php:51
Stack trace:
#0 /var/www/html/limesurvey7/vendor/yiisoft/yii/framework/console/CConsoleCommandRunner.php(71): UpdateDBCommand->run()
#1 /var/www/html/limesurvey7/vendor/yiisoft/yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#2 /var/www/html/limesurvey7/vendor/yiisoft/yii/framework/base/CApplication.php(185): CConsoleApplication->processRequest()
#3 /var/www/html/limesurvey7/application/commands/console.php(77): CApplication->run()
#4 {main}

14. WARNING: Actions on the web interface are performed on LimeSurvey Community Edition Version 6.17.3+260512

15. For this step:
Data Redundancy Check

The redundancy check verifies the presence of tables left after deactivating questionnaires. You can delete them if you no longer need them.

I couldn't check all the boxes at once: I need to check 5,495 boxes to be able to click the <Clear checked items!> button.
This It would be nice to have a button to select them all and avoid using an SQL query.

16. I'm going to test it by deleting all the OLD_answer tables and running the script again.

LimeSurvey version 6.15.x6
OS : RockyLinux / PHP 8.2.X
BDD : PostGresql 17.x /

Future LimeSurvey version 6.17.x
OS : RockyLinux / PHP 8.4.X
BDD : PostGresql 17.x /

Please Log in to join the conversation.

More
1 hour 13 minutes ago #274412 by riqcles
Oups :
sorry the name is lime_old_reponses_ not OLD_answer

LimeSurvey version 6.15.x6
OS : RockyLinux / PHP 8.2.X
BDD : PostGresql 17.x /

Future LimeSurvey version 6.17.x
OS : RockyLinux / PHP 8.4.X
BDD : PostGresql 17.x /

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose