News:

Looking for documentation? Take a look on our wiki

Main Menu

Migrate VM 1.1X to VM 2.X

Started by chrisbti, May 04, 2011, 21:21:17 PM

Previous topic - Next topic

franzpeter

@jjk,
I agree (after reading the content of the provided link). But I think product import is important too. Else, we do not need google. It may be a good idea to add a function to VM to synchronise images, but it is not a good idea to use a database table with all product image information, which, while importing data to that table, creates an autoincrement value. Meanwhile the other product info goes to the product table, which creates another autoincrement value and finally try to link the image to the product with another database table, where you need both autoincrement values. It is a little bit difficult to fit together values from two different tables into a third one, if a table like the jos_virtuemart_medias table has absolutely no relation to other product or category relevant tables. In simple words: one hand does not know what the other hand does!

Milbo

Quote from: franzpeter on July 22, 2011, 18:30:10 PM
it is not a good idea to use a database table with all product image information, which, while importing data to that table, creates an autoincrement value. Meanwhile the other product info goes to the product table, which creates another autoincrement value and finally try to link the image to the product with another database table, where you need both autoincrement values.
This is a completly normal standard behaviour. You can easily use left join to get one dataset. When you want to store clean and performant an array in a database you need your own table for it. It is also done for data integrity, because so we store an image only one time. Medias are also done to be downloadables (not fully implemented yet). Additional it is later in the multivendor scenario also important for multivendor.

Quote from: franzpeter on July 22, 2011, 18:30:10 PM
It is a little bit difficult to fit together values from two different tables into a third one, if a table like the jos_virtuemart_medias table has absolutely no relation to other product or category relevant tables. In simple words: one hand does not know what the other hand does!
this is not true, because there is a xref table, which is like the backbone. Your situation is special. Your distributor is giving you already the paths, but which paths? Are this absolute paths? or absolute Urls?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

franzpeter

I do not exactly understand what the sync media means. Does it mean if I create an insert into the database with values for: vendor_id, file_mimetype, file_type and file_url the sync media is able to create the rest of the rows automatically for example the file_title, the datetime and maybe the thumb?
example for an insert with values:
1, '', '', '', 'image/jpeg', 'product', 'images/stories/virtuemart/product/1b0c96d67abdbea648cd0ea96fd6abcb.jpg', '', NULL, NULL, 1, 1, 0, 0, 0, ''

Does it mean if I click on sync_media all the other rows get filled automatically or do I completely misunderstand the sync media thing?

Milbo

No, synchronise media runs through the directories, which you have defined in the vm config and adds a media entry per file. You may take a look on the function, it is 20 lines.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

franzpeter

Another question: Will there be any database changes (MYSQL) in VM 2.1 in case of products, categories a.s.o.. VM 2 contains a lot of changes inside the database. So it means that all modules, components and plugins need a complete overhaul to work with VM 2. So is it time now to start that overhaul or is the database still to see as a work in progress? I do not talk about scripts, just the database tables!

Milbo

The database tables are stable.

the only thing I remember I maybe change is some fields  from int to bigint. But we didnt changed anything at the tables for almost a month now.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

franzpeter

There is a database table row in the table jos_virtuemart_manufacturers called published. If I set the published to 0 does it mean that Virtuemart just does not show the manufacturer or does it say that if I unpublish a manufacturer all products of that manufacturer are unpublished too?

Milbo

Hmm intersting idea. Atm it just means that you cant see the manufacturer in lists choosing them. and afaik, when you click on the manufacturer view, then the manufacturer shouldnt be shown.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

franzpeter

CSVI or my cli script for example are able to do such things with unpublished categories (my cli script for manufacturers too). If a category is unpublished and if there are published products inside the category it can unpublish those products too. I could imagine, that it would make sense for manufacturers too.
VM 1.1.xx has the problem, that some search components just look for published or unpublished products. So they may find products from unpublished categories too. In VM 2.xx we have now the same situation for both, the unpublished categories and the unpublished manufacturers. It does not matter whether a manufacturer is published or not, the products may be found anyway.
So maybe some left join queries like a search for jos_virtuemart_products (virtuemart_product_id) and  jos_virtuemart_product_manufacturers (virtuemart_product_id) together with published products and unpublished manufacturers to update the jos_virtuemart_products to unpublish would make some sense.
I use it in my cli script too for both to prevent the search component from finding products from unpublished categories or manufacturers.

lindapowers

I was trying to get some information on this topic on how to actually migrate from 1.1x to 2.x.

Ok the tool is there but how does it work? is there any info?

Cause I don't even understand how I'm supposed to migrate. I have VM 1.1.8 do I have to unistall it first? or install 2.0 directly? Do I need to copy files from 1.1.8 via ftp for the migration to 2.0?

Please a bit of basic info on the migration.

franzpeter

@lindapowers
If it would work as expected it would migrate all necessary information from VM 1.1.xx to VM 2.xx.
My personal opinion: I would not recommend to use it on a live shop. For testing purpose, I did use it on my localhost. My Shop has a lot of categories and about 30 000 products. On my localhost I had installed VM 1.1.9 (1.1.8 should work too) with all my data. To install virtuemart 2 I did uninstall VM 1.1.9. The uninstall process does not delete the virtuemart database, only the php files for frontend and backend. VM 2.0 uses new database tables and does not touch the old ones. So I did install VM 2 with the Joomla install component. After that I did choose to migrate (inside Tools from VM 2). I could migrate my customers and the categories from the old VM database. Products and orders did completely fail, maybe 30 000 products are too much for the migrator component. I do not understand why the migration of orders did fail.

But please, do not install VM 2 as live shop, use it for now just for testing purposes on a localhost. Maybe You have better luck with the migration!

lindapowers

Thanks franzpeter, Indeed I had doubts on doing it on a live shop, our shop is much smaller but still I'll wait till the migrator get's more stable/improved.

Milbo

I think Franz-Peter did not tested the C version. Lindapowers, best is you use akeeba backup install the system at home and tries it there.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jeorcal

where can I find the migration tool from VM 1 to 2 ?

thank you

franzpeter

I am able to migrate the shoppers, the customers and the categories. The manufacturers do not work. While importing I receive the following error:
PHP Notice:  Undefined index:   in /htdocs/administrator/components/com_virtuemart/helpers/migrator.php on line 754
I did compare the amount of categories in the old vm1 tables and in VM2 tables, seems that the categories did work. All categories are there.

The script tells me, that is has migrated 579 manufacturers. Result is: Looks everything worked correct, migrated 579 manufacturers
But there is just one manufacturer inside the database and in the VM backend inside the jos_virtuemart_manufacturers. Lacks of 578 manufacturers.
Did not continue with the products, because without the manufacturers it makes no sense to continue.
While migrating I receive the following php notice: Undefined index:   in /htdocs/administrator/components/com_virtuemart/helpers/migrator.php on line 754. The corresponding part causing that is:
$manu['virtuemart_manufacturercategories_id'] = $oldtoNewMfcats[$oldmanu['mf_category_id']];
I have no manufacturer categories in my VM1 database, only the default, which is indeed migrated into jos_virtuemart_manufacturercategories.

I use the newest VM 2 version virtuemart1.9.8.RC2c_extract_first.zip