Welcome to the LimeSurvey Community Forum

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

Update self-hosted LimeSurvey v2.50+ to latest version & Migrate database

  • ketzunouka
  • ketzunouka's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 months 2 weeks ago #267398 by ketzunouka
Please help us help you and fill where relevant:
LimeSurvey version: Version 2.50+
Own server or LimeSurvey Cloud: Own Server
Survey theme/template: *idk where to get this info
==================
(Write here your question/remark)
Hello, I currently have an old self-hosted ( LimeSurvey version v2.50+ ) running with Microsoft SQL Server, here's the version.php file
Code:
$config['versionnumber'] = "2.50+";
$config['dbversionnumber'] = 258;
$config['buildnumber'] = '160529';
$config['updatable'] = true;
$config['assetsversionnumber'] = 14;

Problem:
Currently, there are many `old_survey_xxx` and `tokens_xxx` tables in my database and for the newer LimeSurvey version, there are some schema changes in the tables and also some new tables.

Question:
I have tried to install the newer version of LimeSurvey (LimeSurvey Community Edition Version 6.6.6+241002) and it works normally, how do I migrate my old data (The old_survey_xxx, tokens_xxx, and etc database tables and some data that the schemas have changed in the newer version of LimeSurvey e.g : `answers` table, `users` table, and etc) to my new database?

Looking forward to some suggestions and I would appreciate any insights. Thanks in advance!

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
3 months 2 weeks ago #267404 by DenisChenu
LimeSurvey can update your database directly.

Since it can take time : you can use PHP console for this : github.com/LimeSurvey/LimeSurvey/blob/4e...dateDbCommand.php#L8
You can too update to lesser version.
Start by 2.50 to 3 : github.com/SondagesPro/LimeSurvey-SondagesPro/tree/3.x-LTS
After 3 to 5 : github.com/SondagesPro/LimeSurvey-SondagesPro/tree/5.x
And finally 5 to 6

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.

  • ketzunouka
  • ketzunouka's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 months 2 weeks ago - 3 months 2 weeks ago #267502 by ketzunouka
Thanks for the reply, I've tried to update from LimeSurvey 2.50+  (current `dbversionnumber` is 258) as your recommendation to 3  github.com/SondagesPro/LimeSurvey-SondagesPro/tree/3.x-LTS  (target `dbversionnumber` is 366) but i encountered an error on database upgrade 

CDbCommand failed to execute the SQL statement: SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint "boxes_pkey"
DETAIL: Key (id)=(1) already exists.. The SQL statement executed was: INSERT INTO "boxes" ("position", "url", "title", "ico", "desc", "page", "usergroup") VALUES (:position, :url, :title, :ico, :desc, :page, :usergroup)


I tried the update from console (accessing the /admin page after changing the LimeSurvey files except the config.php) and also from CLI with `php console.php updatedb` command.

root@a007fddcb785:/var/www/html/application/commands# php console.php updatedb
Update pgsql:host=postgresql;port=5432;user=postgres;password=mysecretpwd;dbname=limesurpei; with prefix : from 258 to 366
exception 'CException' with message 'Please fix this error in your database and try again' in /var/www/html/application/commands/UpdateDbCommand.php:49
Stack trace:
#0 /var/www/html/framework/console/CConsoleCommandRunner.php(71): UpdateDBCommand->run(Array)
#1 /var/www/html/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run(Array)
#2 /var/www/html/framework/base/CApplication.php(185): CConsoleApplication->processRequest()
#3 /var/www/html/application/commands/console.php(70): CApplication->run()
#4 {main}


I know it's a common error, the error is likely because it's trying to insert a row with an id value that already exists in the boxes table, but how to resolve this issue in LimeSurvey scenario ?

In addition, i've also tried to update from LimeSurvey 2.50+  (current `dbversionnumber` is 258) to version 6.6.6 (target `dbversionnumber` is 623), and i got the same error. But, i noticed that the current db version from my LimeSurvey 2.50+ has changed from 258 to 337. I attach the screnshoot for this case. Any suggestions for this issue ? I think the problem starts from dbversionnumber 337.

Thankyou 

 

 
Last edit: 3 months 2 weeks ago by ketzunouka. Reason: another typo fix

Please Log in to join the conversation.

Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose