Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems upgrading from vtiger 5.2.1
#1
Hello,
I'm trying to upgrade from vtiger 5.2.1 to coreBOS and I'm having some problems. The database is about 10 GB.

When attempting this upgrade using the CoreBOS migration, the Database Changes apply and then the install stops. Here are the results:
FAILURE ALTER TABLE vtiger_field CHANGE COLUMN selected defaultvalue TEXT default ''
FAILURE UPDATE vtiger_field SET defaultvalue='' WHERE defaultvalue='0'
FAILURE UPDATE vtiger_field SET presence = 2 WHERE tabid= AND fieldname = 'ship_pobox'

When attempting to run these queries through the mysql commandline, I receive the following:
mysql> ALTER TABLE vtiger_field CHANGE COLUMN selected defaultvalue TEXT default '';
ERROR 1170 (42000): BLOB/TEXT column 'defaultvalue' used in key specification without a key length
mysql> UPDATE vtiger_field SET defaultvalue='' WHERE defaultvalue='0';
ERROR 1054 (42S22): Unknown column 'defaultvalue' in 'where clause'
mysql> UPDATE vtiger_field SET presence = 2 WHERE tabid= AND fieldname = 'ship_pobox';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND fieldname = 'ship_pobox'' at line 1

Now, when I attempt to login, I get the "Migration Incomplete" message and I have to go through the Migration again, which stops at the Database Changes place again.
However, if I run this query: update vtiger_version set current_version='5.5.0';
Then, I can login to the application.

BUT, when I login I can't see any of the modules except for ConfigEditor and WSAPP.
If I go to the MenuEditor URL directly, it still shows only those 2 modules.
I also tried going to the direct URL for the CoreBOS Updater, but the application says that cbupdate is not enabled, and since I don't see it in the Module Manager, I can't turn it on.

My best guess is that the migration stopped after receiving some FAILUREs and there was more to be done.
I have backups of everything, so I can always retry a new migration, but I don't know where to go from here.
Any ideas?
Reply
#2
(04-16-2016, 12:06 PM)gorundown Wrote: ALTER TABLE vtiger_field CHANGE COLUMN selected defaultvalue TEXT default ''
UPDATE vtiger_field SET defaultvalue='' WHERE defaultvalue='0'

In 5.3 the vtiger_field.selected column was renamed to vtiger_field.defaultvalue, that is what the two lines above do. You are probably getting an error because it isn't the first time they are executed. They will only work once, after that the "selected" column doesn't exist anymore so they fail. I think you can safely ignore those two.

(04-16-2016, 12:06 PM)gorundown Wrote: FAILURE UPDATE vtiger_field SET presence = 2 WHERE tabid= AND fieldname = 'ship_pobox'

This is the important one, for some reason the code cannot read the tabdata.php file so it can't get the Quote tabid.

Recover your database from your copy, then make sure al files are writable and finally copy the parenttab.php and tabdata.php files from your production site into the migration test site. Over write the ones in the migration test.

(04-16-2016, 12:06 PM)gorundown Wrote: My best guess is that the migration stopped after receiving some FAILUREs and there was more to be done.

I agree, this is what happened.


(04-16-2016, 12:06 PM)gorundown Wrote: I have backups of everything, so I can always retry a new migration, but I don't know where to go from here.

Nice !! Very smart move :-)

One last thing. I just tried the migration to make sure it was still working and I found an error which has nothing to do with your case but that you may run into if you advance to the next step. I committed the code to github repository so please, update your copy before continuing.

Keep us informed.
Joe
TSolucio
Reply
#3
Thanks Joe!  I'll let you know how it goes!
Reply
#4
OK, 2 down, still one more to go.

I downloaded a new copy of corebos-master.zip (from your recommendation).

There was an index on the vtiger_field table that included the selected field. After removing the index, these 2 queries worked with no issues:
ALTER TABLE vtiger_field CHANGE COLUMN selected defaultvalue TEXT default ''
UPDATE vtiger_field SET defaultvalue='' WHERE defaultvalue='0'

I tried copying over the tabdata.php and parent_tabdata.php from the production system after they were overwritten with the corebos-master code.
However, this still happens:
FAILURE UPDATE vtiger_field SET presence = 2 WHERE tabid= AND fieldname = 'ship_pobox'

It's been a long time since this instance of vtiger 5.2.1 was setup, so there is a good possibility that changes were made to the code and database directly to remove modules and change the look and feel of vtiger. Is there something else that you can recommend?
Reply
#5
Does the Quotes module have an entry in the tabdata.php file. Maybe it is deactivated, you could try adding it in or activating the module in the 5.2.1 before trying to migrate.
Paste your tabdata.php file here.
Joe
TSolucio
Reply
#6
(04-17-2016, 11:41 AM)joebordes Wrote: Does the Quotes module have an entry in the tabdata.php file. Maybe it is deactivated, you could try adding it in or activating the module in the 5.2.1 before trying to migrate.
Paste your tabdata.php file here.

Quotes is deactivated in vtiger 5.2.1

Attached are the 2 tabdata files.  It looks like Quotes is not in there.  Where should I add it?


Attached Files
.php   tabdata.php (Size: 1.6 KB / Downloads: 1)
.php   parent_tabdata.php (Size: 380 bytes / Downloads: 0)
Reply
#7
The tabdata.php file that comes with coreBOS has it, so if the migration isn't working with that file it is because it is regenerated with the information in your 5.2.1 database.
That means that the code is incorrect, it shouldn't be counting on having the module active to get the tabid, it should go directly to the database.
I can fix that but I'm afraid there is going to be a lot more of those errors present. Can you activate those modules in your 5.2.1 and do the migration with them active and then deactivate them again once on coreBOS?
Joe
TSolucio
Reply
#8
OK, install is all done.  Received one warning: Warning: Missing argument 2 for ExecutePQuery(), called in /var/www/vtigercrm/modules/Migration/DBChanges/530_to_540rc.php on line 177 and defined in /var/www/vtigercrm/include/install/resources/utils.php on line 1318

Everything else completed with a SUCCESS.  I clicked Next and finished the install which brings me to the CoreBOS login screen.

But now, I can't login.  I tried the "Reset admin password trick in vtiger" in the database: 1UPDATE vtiger_users SET user_password = 'adpexzg3FUZAk', crypt_type='' WHERE id=1;

So now it's User: admin, Password: admin.
But I get the same outcome.  You enter the credentials at the login screen and attempt to login, nothing happens.  The login screen is comes back with no errors (basically it looks like you just hit the refresh button in the browser).  I tried going through the code and adding breaks to see how far it's getting.

It gets past line 25 in the modules/Users/Authenticate.php file: if($focus->is_authenticated()) {
Because I added a: echo "here\n";  die;    --> And it got there, so I know the password is "working", but it just doesn't seem to be setting the session variables or something like that.

I see no errors in the Apache Logs, and no errors appear in the browser.  Is there some other logging I can setup to see what's going on?

Any ideas?
Reply
#9
Check permissions and existence of user_privileges files.

permissions in user_privielges, Smarty/templates_c, cache,

edit config.inc.php and add


PHP Code:
error_reporting(E_ALL); 


see if that gives you some clue

also try activating debug log to see what that says.

http://corebos.org/documentation/doku.ph...buging#php

I fixed the warning:

https://github.com/tsolucio/corebos/comm...7e5b92L177

Thanks !
Joe
TSolucio
Reply
#10
Turned on log4php logging. Here's what it's showing:

2016-04-30T18:42:35+00:00 DEBUG index authenticated_user_theme is softed
2016-04-30T18:42:35+00:00 DEBUG index authenticated_user_language is en_us
2016-04-30T18:42:35+00:00 DEBUG index authenticated_user_id is 1
2016-04-30T18:42:35+00:00 DEBUG index app_unique_key is REDACTED
2016-04-30T18:42:35+00:00 DEBUG index function getTranslatedString(APP_NAME) - translated to (coreBOS)
2016-04-30T18:42:35+00:00 DEBUG index function getTranslatedString(LNK_PRIVACY_POLICY) - translated to (Privacy Policy)
2016-04-30T18:42:35+00:00 INFO VT PearDatabase ->ADODB disconnect
2016-04-30T18:42:35+00:00 DEBUG VT query being executed : SELECT * FROM vtiger_version
2016-04-30T18:42:35+00:00 DEBUG VT Entering set_default_config(Array
(
[allow_exports] => all
[upload_maxsize] => 3000000
[listview_max_textlength] => 40
[php_max_execution_time] => 0
)
) method ...
2016-04-30T18:42:35+00:00 DEBUG VT Exiting set_default_config method ...
2016-04-30T18:42:35+00:00 DEBUG index ****Starting for new session
2016-04-30T18:42:35+00:00 DEBUG index The current user does not have a session. Going to the login page
2016-04-30T18:42:35+00:00 DEBUG index Entering return_module_language(,Users) method ...
2016-04-30T18:42:35+00:00 WARN index Unable to find the module language file for language: and module: Users
2016-04-30T18:42:35+00:00 DEBUG index Exiting return_module_language method ...
2016-04-30T18:42:35+00:00 DEBUG index Entering return_application_language(en_us) method ...
2016-04-30T18:42:35+00:00 DEBUG index Exiting return_application_language method ...
2016-04-30T18:42:35+00:00 INFO VT PearDatabase ->ADODB getColumnNames table=vtiger_organizationdetails
2016-04-30T18:42:35+00:00 DEBUG index Prepared sql query being executed : select * from vtiger_organizationdetails

You can see that it finds the user and pulls information from the record. Then suddenly, it says the current user does not have a session

Also, the language field wasn't set for admin, so I ran this query: update vtiger_users set language='en_us' where user_name='admin';

Set error_logging to all and this shows up on the Login:
Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vtigercrm/adodb/adodb.inc.php on line 893 Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vtigercrm/adodb/adodb.inc.php on line 1919 Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vtigercrm/adodb/adodb.inc.php on line 1991 Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vtigercrm/adodb/adodb-xmlschema.inc.php on line 373 Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vtigercrm/adodb/adodb-xmlschema.inc.php on line 385 Notice: Undefined index: path in /var/www/vtigercrm/include/utils/Session.php on line 52


When I attempt to login, the previous messages are no longer there, but instead I see this: Notice: Undefined index: path in /var/www/vtigercrm/include/utils/Session.php on line 52

I'm still not able to login and there's nothing that's standing out as the problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)