AwoCoupon migration from v1 on VM1 to v2 on VM2


  • Default avatar
    sergio5    
     10 years ago
    0

    I've purchased the extension so now I feel more comfortable bothering you with support requests :-)

    Situation: I am migrating a Joomla 1.5 + VirtueMart 1 + AwoCoupon 1 site to a Joomla 2.5 +VirtueMart 2 + AwoCoupon 2 Pro. I want to migrate as much data as possible without the user entering them. For VirtueMart data migration, I export with CSVI, process a bit the intermediate file, and then import with CSVI. Now I need to move all AwoCoupon coupons.

    * I can do whatever PHP / MySQL required
    * I have full access to both sites / servers
    * I can produce a temporary copy of both sites

    Let's do this one step at a time.

    1. What's the best way to export coupons from AwoCoupon 1 on the VM 1 site in a CSV / XML file which does NOT contain ids but skus and names? Do I need to run a specific query on the table?

    Thank you very much for your support.
  • Your avatar
    seyi    
     10 years ago
    0

    Hello,

    CSVI supports AwoCoupon, have you looked to see if it is an option for importing/exporting 1 to 2?


    Ok, as I understand you are upgrading form AwoCoupon 1 Free to AwoCoupon 2 Pro. Is this correct?
  • Default avatar
    sergio5    
     10 years ago
    0

    > As I understand you are upgrading form AwoCoupon 1 Free to AwoCoupon 2 Pro. Is this correct?

    Correct.

    > CSVI supports AwoCoupon, have you looked to see if it is an option for importing/exporting 1 to 2?

    I can use CSVI to import into AwoCoupon 2 / VM 2, but not to export the data. So I'm still at the phase where I am trying to export some meaningful data from AwoCoupon 1 / VM 1. Before proceeding to write some scripts / queries, is there any additional info / tool you can suggest?

    Thank you.
  • Default avatar
    sergio5    
     10 years ago
    0

    FYI, I ran manually some custom queries to get decoded data (i.e. email instead of user_id, coupon_code instead of coupon_id, product_sku instead of product_id)

    Export jos_awocoupon

    SELECT `coupon_code`, `num_of_uses`, `coupon_value_type`, `coupon_value`, `min_value`, `discount_type`, `function_type`, `expiration`, `published`
    FROM `jos_awocoupon`

    Export decoded data for jos_awocoupon_product

    SELECT c.coupon_code, p.product_sku
    FROM `jos_awocoupon_product` cp
    LEFT JOIN `jos_awocoupon` c ON cp.coupon_id = c.id
    LEFT JOIN `jos_vm_product` p ON cp.product_id = p.product_id

    Export decoded data for jos_awocoupon_user_uses

    SELECT c.coupon_code, u.email, cuu.num
    FROM `jos_awocoupon_user_uses` cuu
    LEFT JOIN jos_awocoupon c ON cuu.coupon_id = c.id
    LEFT JOIN jos_users u ON cuu.user_id = u.id



    I will now look into CSVI to see what I can do with these data :-)
  • Your avatar
    seyi    
     10 years ago
    0

    Hello,

    As the AwoCoupon you are updating from is Free, then this should be a pretty easy upgrade. I would first upgrade from AwoCoupon 1 Free to AwoCoupon 2 Free, and then using joomla installer, install AwoCoupon 2 Pro, which will automatically fix it for pro.

    So on the new site, install AwoCoupon 2 Free, and add the AwoCoupon 1 tables to the same database. Then you can do the below to upgrade it:
    INSERT INTO #__awocoupon_vm (id,coupon_code,num_of_uses,coupon_value_type,coupon_value,min_value,discount_type,function_type,function_type2,startdate,expiration,published)
        SELECT id,coupon_code,num_of_uses,coupon_value_type,coupon_value,min_value,discount_type,function_type,"product",null,expiration,published FROM #__awocoupon;
    INSERT INTO #__awocoupon_vm_product SELECT * FROM #__awocoupon_product;
    INSERT INTO #__awocoupon_vm_user SELECT * FROM #__awocoupon_user;
    INSERT INTO #__awocoupon_vm_history SELECT * FROM #__awocoupon_user_uses;


    This gets it into AwoCoupon 2 Free, then install AwoCoupon 2 Pro.
  • Default avatar
    sergio5    
     10 years ago
    0

    I followed the procedure and it went fine, thank you.

    BUT: I don't have the same product ids between my VM 1 and VM 2 site, so basically the coupons <-> products and coupons <-> users associations are screwed :-)

    I still have to rebuild the #__awocoupon_vm_product and #__awocoupon_vm_history tables with some advanced query. I will let you know.