How migrate products comments from Pshop1.6



  • I want to migrate the product comments from the stock prestashop module over to a new instance of thirty bees. I’m sure there is a relatively easy way to do this. I just don’t know how. I migrated everything else already. Just need this piece.

    Can someone help?


  • administrators

    Do you want to migrate the data or the whole module?



  • I figured it’s probably easier to just move the data over to the thirty bees module since it’s likely structured the same. I’ll do whatever works and is easiest.


  • administrators

    In that case you might want to migrate just these database tables:

    PREFIX_product_comment
    PREFIX_product_comment_criterion
    PREFIX_product_comment_criterion_product
    PREFIX_product_comment_criterion_lang
    PREFIX_product_comment_criterion_category
    PREFIX_product_comment_grade
    PREFIX_product_comment_usefulness
    PREFIX_product_comment_report



  • I tried this today and when I try and import the data, I get a primary key error. First it’s on the criterion table. Then when I omit that, I get it on other tables.

    I tried importing before I installed the module also. This gets around the primary key errors, but after module configure, the comment module doesn’t function correctly. In this case, if I enter a new comment on a product to test and approve it, it never shows up on the product’s review pane after approval. Suggestion?

    In both scenarios, I’m not seeing the review notification working on the dashboard. It always shows 0 no matter how many are submitted during the time period.


  • administrators

    How did you try to migrate the data? You could drop the existing tables first and then execute the CREATE TABLE query, followed by the INSERT ones.



  • I just used the export (sqldump?) feature of phpmyadmin. Renamed the tables to match the prefix in the new database.

    Sorry, but I’m not a DBA or even close. What are the basic steps to attempt the way you’re mentioning?



  • There’s following SQL clauses in the SQL dump, check, whether it present in your SQL dump:
    Before inserting table data: /*!40000 ALTER TABLE your_table_name DISABLE KEYS /;
    After inserting table data /
    !40000 ALTER TABLE your_table_name ENABLE KEYS */;

    If not, just add it manually, or make dump again, with appropriate options. Try to use HeidiSQL for this.



  • I think I understand what you’re saying, but don’t have HeidiSQL. Tried installing but can’t figure out how to connect it.



  • HI DaoKakao,

    HEidiSQL is great. I use it all the time while switching live and local installations of 30bz. Funny thing is, today I tried to migrate my Yotpo reviews (those we gathered in our shop over years) into the productcomments module’s tables you have shown above.
    Since I can not mysql by heart I tried it via Scalc CSV and a normal texteditor. But I ran into much search&replace issues and so on. Biggest issue is, that my Yotpo review export, that comes in CSV, has only customer name and customer email but not customer_ID. You need that for the module. So, may be I am going to use mysql INSERT table by table.
    So, why I am telling this :)

    Well, actually I would be much happier if the product comments module could be enhanced. At least for an CSV import function. Just like the general csv import functions for categories and articles etc that offer eben a template csv download.
    Then the module could merge or bind customer_email with the relating customer_id that is already in the db of customers who at least registered their email.

    Next step would be then to enhance the module with the jsonmodule-v1.0.1markup, after checkout reminder mail and Bees are ready for SEO and customer usability (sensing visually good products in the hive :) in the future without being dependent on Yotpo and Co. vulture companies.

    /vote4kickstart



  • @mdekker Tried your way using two separate dumps. One for structure, one for data. Still not working correctly.



  • @x97wehner I mensioned Heidi just because this is a tool for “not dba” people, it could help you with various options, which you may not have to know.

    More important is sql clauses i’ve pasted from my dump. This is what switches off the table keys before inserting data and switches on that keys after data inserts complete



  • I’m pretty sure I inserted the snippets in correctly. When I ran the import, I got the same error I’ve seen a few times already which is telling me the keys didn’t disable correctly.

    Error

    SQL query:


    – Dumping data for table tbxn_product_comment_criterion

    INSERT INTO tbxn_product_comment_criterion (id_product_comment_criterion, id_product_comment_criterion_type, active) VALUES
    (1, 1, 1);

    MySQL said: Documentation
    #1062 - Duplicate entry ‘1’ for key ‘PRIMARY’

    Here is the beginning of the dump file:
    – phpMyAdmin SQL Dump
    – version 4.3.8
    http://www.phpmyadmin.net

    – Host: localhost
    – Generation Time: Oct 09, 2017 at 04:01 PM
    – Server version: 5.5.51-38.2
    – PHP Version: 5.6.30

    SET SQL_MODE = “NO_AUTO_VALUE_ON_ZERO”;
    SET time_zone = “+00:00”;

    /*!40000 ALTER TABLE tbxn_product_comment DISABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_criterion DISABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_criterion_category DISABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_criterion_lang DISABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_criterion_product DISABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_grade DISABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_report DISABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_usefulness DISABLE KEYS /;
    /
    !40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT /;
    /
    !40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS /;
    /
    !40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION /;
    /
    !40101 SET NAMES utf8 */;

    And here is the end of the dump file:
    – AUTO_INCREMENT for table tbxn_product_comment_criterion

    ALTER TABLE tbxn_product_comment_criterion
    MODIFY id_product_comment_criterion int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
    /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT /;
    /
    !40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS /;
    /
    !40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION /;
    /
    !40000 ALTER TABLE tbxn_product_comment ENABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_criterion ENABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_criterion_category ENABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_criterion_lang ENABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_criterion_product ENABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_grade ENABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_report ENABLE KEYS /;
    /
    !40000 ALTER TABLE tbxn_product_comment_usefulness ENABLE KEYS */;



  • obviously this forum truncated the asterisks in the statements


  • administrators

    It looks like there was already a value in the table, if you are exporting just the content make sure the table is empty.



  • That’s why i adviced to try the HeidiSQL. It has an option for database dump, which force to generate not “DROP TABLE”, but “DELETE FROM TABLE” instead - i did exactly this way and managed to transfer data from one database to another



  • Thanks. As far as I can see I got the data moved correctly. There are some other issues that I haven’t debugged yet though.



  • I opened a different bug report because I’m still experiencing issues with the functionality of the comments module. The migration was done and I"ve triple checked the data and it’s correct. The new topic is https://forum.thirtybees.com/topic/932/product-comments-module-bugs


Log in to reply
 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.