Welcome to the LimeSurvey Community Forum

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

php application/commands/console.php updatedb fails

  • cavo789
  • cavo789's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 months 3 weeks ago #255197 by cavo789
Your LimeSurvey version: 6.2.4
Own server or LimeSurvey hosting: own server
==================
Good morning

I'm trying to migrate a very old LimeSurvey instance (v3.x) to 6.2.4. I've made a backup of the previous db (both using web interface or mysqldump on the server); the file is 340MB then I copy the backup to my LS 6.2.4 new server and each time I get the following error 

```bash
sudo php -d memory_limit=-1 application/commands/console.php updatedb
Update mysql:host=xxxxx;port=xxxxx;dbname=xxxxxxxxx; with prefix :xxxxxx from 359 to 612
CException: Please fix this error in your database and try again in /var/www/html/limesurvey_r_o/application/commands/UpdateDbCommand.php:50
Stack trace:
#0 /var/www/html/limesurvey_r_o/vendor/yiisoft/yii/framework/console/CConsoleCommandRunner.php(71): UpdateDBCommand->run()
#1 /var/www/html/limesurvey_r_o/vendor/yiisoft/yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#2 /var/www/html/limesurvey_r_o/vendor/yiisoft/yii/framework/base/CApplication.php(185): CConsoleApplication->processRequest()
#3 /var/www/html/limesurvey_r_o/application/commands/console.php(77): CApplication->run()
```

The error returned by LimeSurvey didn't help to understand what I need to do.

So, the DB migration is from 359 to 612.

If I rerun the exact same statement, I see: "from 418 to 612" and it crashes again.

And now if I rerun again, the version number still stay on 418.

Did you have any idea how I can solve this?

Thanks!

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 months 3 weeks ago #255224 by DenisChenu

The error returned by LimeSurvey didn't help to understand what I need to do.

 
Yes: this need to be fixed, clearly a bug here. Can you report it please ?
community.limesurvey.org/bug-tracker/


The 419 update is here : github.com/LimeSurvey/LimeSurvey/blob/ma...dates/Update_419.php

If this table already exist : maybe delete it ? (unsure)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

  • cavo789
  • cavo789's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 months 3 weeks ago #255234 by cavo789
Merci Denis.

Done, but created bugs.limesurvey.org/view.php?id=19385

I'll take a look if I can remove the table `419` and see what happens. Will come back.

Please Log in to join the conversation.

  • cavo789
  • cavo789's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 months 3 weeks ago #255235 by cavo789
I've more than 13,000 tables in my db. I've exported the list of tables in a .txt files and remove any lines starting with "prefix_survey", "prefix_tokens" and "prefix_participant" to get something easier to read.

i've also "prefix_old_xxx" tables (I'll try to remove them first).

Here is the list of remaining tables:

prefix_answer_l10ns
prefix_answers
prefix_archived_table_settings
prefix_assessments
prefix_asset_version
prefix_boxes
prefix_conditions
prefix_defaultvalue_l10ns
prefix_defaultvalues
prefix_expression_errors
prefix_failed_emails
prefix_failed_login_attempts
prefix_group_l10ns
prefix_groups
prefix_label_l10ns
prefix_labels
prefix_labelsets
prefix_map_tutorial_users
prefix_message
prefix_notifications
prefix_permissions
prefix_permissiontemplates
prefix_plugin_settings
prefix_plugins
prefix_question_attributes
prefix_question_l10ns
prefix_question_themes
prefix_questions
prefix_quota
prefix_quota_languagesettings
prefix_quota_members
prefix_saved_control
prefix_sessions
prefix_settings_global
prefix_settings_user
prefix_source_message
prefix_template_configuration
prefix_templates
prefix_tutorial_entries
prefix_tutorial_entry_relation
prefix_tutorials
prefix_user_groups
prefix_user_in_groups
prefix_user_in_permissionrole
prefix_users

Should I remove somes?

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 months 3 weeks ago - 2 months 3 weeks ago #255236 by DenisChenu
You already have user_in_permissionrole and permissiontemplates table : this explain why upgfrade broke.

2 solutions :
- delete this tables
- comment the action done here : github.com/LimeSurvey/LimeSurvey/blob/ma...dates/Update_419.php

file :
Code:
<?php
 
namespace LimeSurvey\Helpers\Update;
 
class Update_419 extends DatabaseUpdateBase
{
    public function up()
    {
        // deactivate since broke
    }
}

PS : edit your bug report, since the important things is the error.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 2 months 3 weeks ago by DenisChenu.
The following user(s) said Thank You: cavo789

Please Log in to join the conversation.

  • cavo789
  • cavo789's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 months 3 weeks ago - 2 months 3 weeks ago #255244 by cavo789
Merci Denis.

I'll restart the importation from scratch because I think I've made somes errors (remove tables and remove code). Will keep you informed.

(I will update the bug as soon as I can have more valuable info)

 
Last edit: 2 months 3 weeks ago by cavo789.

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 months 3 weeks ago - 2 months 3 weeks ago #255247 by DenisChenu
I mean 2 solution : choose the first OR the second not both !!!

Receiving the alert with the 1st message ;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 2 months 3 weeks ago by DenisChenu. Reason: Receiving the alert with the 1st message ;)

Please Log in to join the conversation.

  • cavo789
  • cavo789's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 months 3 weeks ago #255297 by cavo789
Ok, I've succeed with the migration by following these following steps.

1. Dump using mysql-dump of my old LimeSurvey v3 instance
2. Import using mysql CLI command on my new LimeSurvey v6 MySQL db.
3. Run `sudo php -d memory_limit=-1 application/commands/console.php updatedb` on the command line.
4. After a while, I got the error mentioned in my first post. I don't "care" and rerun the exact same command.

The difference is that, first, the update message was `from 359 to 612` and, the now `from 418 to 612`.

As stated by you Denis, so, there is something "wrong" with the Update_419 script. That script is creating two tables: github.com/LimeSurvey/LimeSurvey/blob/ma...es/Update_419.php#L9 and github.com/LimeSurvey/LimeSurvey/blob/ma...s/Update_419.php#L23

5. In open a MySQL console and drop these two tables using `DROP TABLE myprefix_xxx;`
6. I rerun the `sudo php -d memory_limit=-1 application/commands/console.php updatedb` for the third time and it'll fail again.
7. I rerun for the fourth time `sudo php -d memory_limit=-1 application/commands/console.php updatedb` and now, the message is `from 420 to 612` so, now, I've to check the `Update_421` script. Identify there tables; go to my MySQL console, drop the table and continue...

In my situation, I had problems with 419, 420, 446 and 480.

I've absolutely no idea why there is a `createtable` function in the php scripts for tables already present in my LS v3.x database. These tables were present by empty.

So, for me, the issue is solved. I'll copy this message in the bug ( bugs.limesurvey.org/view.php?id=19385 )

**Merci pour ton aide Denis.**
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 months 3 weeks ago #255300 by DenisChenu
OK,
Then : 5 issues found …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.

Please Log in to join the conversation.

  • cavo789
  • cavo789's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 months 3 weeks ago - 2 months 3 weeks ago #255310 by cavo789
I've removed these tables:

```sql
DROP TABLE myprefix_permissiontemplates; // 419
DROP TABLE myprefix_user_in_permissionrole; // 419
DROP TABLE myprefix_question_themes; // 421
DROP TABLE myprefix_archived_table_settings // 446
DROP TABLE myprefix_source_message // 480
DROP TABLE myprefix_message // 480
```
```
Last edit: 2 months 3 weeks ago by cavo789.
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose