Migration - Keep old product_id - configuration option missing?

Started by AH, January 19, 2014, 16:05:23 PM

Previous topic - Next topic

Milbo

Imho I added the option for this already, so if you created a fix for it, just follow this link http://dev.virtuemart.net/projects/virtuemart/wiki/Setting_up_a_Development_Environment

create a patch, post it here, it will fit for vm2.0 and vm2.2 series.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Kintaro Oe

is this included in the 2.6 migrator?

p.s. in the meantime i SOLVED with this: http://forum.virtuemart.net/index.php?topic=121624.msg415847#msg415847

csho

As far as I see, it is not included...
I am trying to fix this in 2.6.
Could you upload a patch or something? I am confused a bit where to paste these lines you mention.

I tried the SQL you mention in a post of yours but I get "Duplicate entry  for key 'i_virtuemart_product_id'" etc errors.
Any ideas?



AH

Nope it is not included in 26a

Note that the image filename in the migrator is populated in the product table, this is not very helpful if migrating as filenames are normally awful for images in old VM e.g. something__4fd1d7a791926.jpg  Not great seo alt tag!

around line 391
foreach($filesInDir as $file){

$data = null;
$data = array('file_title' => $file['filename'],
    'virtuemart_vendor_id' => 1,
    'file_description' => $file['filename'],
    'file_meta' => $file['filename'],


so I stopped this happening:-

//QUORVIA removed this because the image ALT was being given the filename which is a crappy name in VM!
//       'file_description' => $file['filename'],
//     'file_meta' => $file['filename'],


around line 1234

replace

if($this->_keepOldProductIds){
$product['virtuemart_product_id'] = $product['product_id'];
}

$product['virtuemart_product_id'] = $productModel->store($product);

with


if($this->_keepOldProductIds){
$product['virtuemart_product_id'] = $product['product_id'];
}

$product['virtuemart_product_id'] = $productModel->store($product);
//Quorvia mbarry solution
                    $product['virtuemart_product_id'] = $this->_updateTableId('virtuemart_product_id', $product['virtuemart_product_id'], $product['product_id'], 'product');
//quorvia end


This might help you
Regards
A

Joomla 4.4.5
php 8.1