News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Migration error vm 2.0.22

Started by harrstar, July 12, 2013, 22:30:48 PM

Previous topic - Next topic

harrstar

Had several times unsuccessfully tries to migrate a shop from 1.1.19 to 2.0.22. It ports everything but the user's BT addresses, ST addresses are migrated just fine.

It always comes up with this error message

vmError: port shoppers db error 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 '`vmu`.virtuemart_user_id FROM j25sc_vm_user_info AS `ui` LEFT OUTER JOIN j25' at line 1 SQL=SELECT `ui`.*,`svx`.*,,`vmu`.virtuemart_user_id FROM j25sc_vm_user_info AS `ui` LEFT OUTER JOIN j25sc_vm_shopper_vendor_xref AS `svx` ON `svx`.user_id = `ui`.user_id LEFT OUTER JOIN j25sc_users AS `p` ON `p`.id = `ui`.user_id LEFT OUTER JOIN j25sc_virtuemart_vmusers AS `vmu` ON `vmu`.virtuemart_user_id = `ui`.user_id WHERE (`vmu`.virtuemart_user_id) IS NULL LIMIT 0,1000
vmError: port shoppers db error SELECT `ui`.*,`svx`.*,,`vmu`.virtuemart_user_id FROM #__vm_user_info AS `ui` LEFT OUTER JOIN #__vm_shopper_vendor_xref AS `svx` ON `svx`.user_id = `ui`.user_id LEFT OUTER JOIN #__users AS `p` ON `p`.id = `ui`.user_id LEFT OUTER JOIN #__virtuemart_vmusers AS `vmu` ON `vmu`.virtuemart_user_id = `ui`.user_id WHERE (`vmu`.virtuemart_user_id) IS NULL LIMIT 0,1000

I think the problem is at the red marked part of the query. I found the query in migrator.php, line 579. It contains a variable called $JUserString. But, this var seems undeclared as the declaration above the query is commented out.

I have now idea what this var should contain, any hints?

Uwe
Joomla 2.5.25 and vm 2.6.10

harrstar

OK.

I replaced the part with 'p.*' and it worked, no more error message. Now checking if everything went well.

Uwe
Joomla 2.5.25 and vm 2.6.10

AH

Keep us forum watchers updated please
Regards
A

Joomla 3.10.11
php 8.0

AH

HI

I think that you should not edit the code!

If you make sure you have a user set as a vendor BEFORE migrating users then there should be no errors

Try setting the vendor and then migrate just the users
Regards
A

Joomla 3.10.11
php 8.0

harrstar

Hi,


As it turns out this edit was necessary to make it work at all. If you have a look at the code, the generated SQL query has a missing argument. And that independently of any vendor definition (I tried it).

BUT, it does not work correctly. The BT addresses are not migrated correctly, there are missing addresses (3000 converted out of 5000) and wrong links in between users and addresses. Still trying to figure this one out and will keep posting

Uwe
Joomla 2.5.25 and vm 2.6.10

AH

Hmm, I tried to migrate again and got a similar message

After running through a couple of times I still get the message but I see users - I should check the old and new data files to see if values/id s match
Regards
A

Joomla 3.10.11
php 8.0

harrstar

Hi,

I am done now migrating all users. Turns out that the migration is working correctly. The only thing I had to do was comment out line 548  in migrator.php

"return false;"

because this line would prevent the script from converting all the users. I had to run the migration multiple times (users only) to convert all users.

Uwe
Joomla 2.5.25 and vm 2.6.10

AH

excellent

That is what I did (except the removal of the line)

Wonder why it worked for me?

Now check your order items data and you might see that the order tax details etc are incomplete due to new fiedls in VM2

Look at an order inthe backedn of Vm
Regards
A

Joomla 3.10.11
php 8.0

harrstar

Joomla 2.5.25 and vm 2.6.10

AH

LOL that is my post!

It does not fix the direct_virtuemart_order_items

e.g. field product_tax

Of course if you tax only the final bill amount this post may not be of much use! LOL
Regards
A

Joomla 3.10.11
php 8.0

harrstar

Uuups, sorry.

Just checked the old order_items table and there are no fields for the tax as in the new one. And the migration is not taking care of that by calculating the tax. Guess you have to life with no tax amounts in the items table.

I think that's not too bad as the total tax amount is correct (after the fix). And for european tax purposes you can still have an old version of vm on the server to reprint orders. And the user usually does not care as long as the totals are correct

Uwe
Joomla 2.5.25 and vm 2.6.10

AH

It is pretty simple to populate the tax values using the data on the table

UPDATE xxx SET   yyy = "aaa" - "bbb"

etc.
Regards
A

Joomla 3.10.11
php 8.0

AH

Some data for order-items is recreated in vm2.0.22a  however not all!

Working on the solution now!
Regards
A

Joomla 3.10.11
php 8.0

Milbo

Uwe, how works the vm2.0.22a for you?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

AH

#14
Max

This solves the item issue.

in migrator.php

At line 1456 change to this

Quote
//quorvia no tax in vm1.1.9 tables!
//                  $item['product_discountedPriceWithoutTax'] = $item['product_final_price']   -  $item['product_tax'];
                  $item['product_discountedPriceWithoutTax'] = $item['product_item_price'];
                  $item['product_priceWithoutTax'] = $item['product_item_price'];
                  $item['product_tax'] = $item['product_final_price'] - $item['product_item_price'];
                  $item['product_basePriceWithTax'] = $item['product_final_price'];
//quorvia end      
Regards
A

Joomla 3.10.11
php 8.0