x97wehner Posted October 9, 2017 Posted October 9, 2017 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?
0 x97wehner Posted October 9, 2017 Author Posted October 9, 2017 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.
0 x97wehner Posted October 9, 2017 Author Posted October 9, 2017 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.
0 x97wehner Posted October 9, 2017 Author Posted October 9, 2017 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?
0 DaoKakao Posted October 9, 2017 Posted October 9, 2017 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.
0 x97wehner Posted October 9, 2017 Author Posted October 9, 2017 I think I understand what you're saying, but don't have HeidiSQL. Tried installing but can't figure out how to connect it.
0 Pedalman Posted October 9, 2017 Posted October 9, 2017 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 customeremail with the relating customerid 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
0 x97wehner Posted October 9, 2017 Author Posted October 9, 2017 @mdekker Tried your way using two separate dumps. One for structure, one for data. Still not working correctly.
0 DaoKakao Posted October 9, 2017 Posted October 9, 2017 @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
0 x97wehner Posted October 9, 2017 Author Posted October 9, 2017 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 SQLMODE = "NOAUTOVALUEONZERO"; SET timezone = "+00:00"; /!40000 ALTER TABLE tbxn_product_comment DISABLE KEYS */; /!40000 ALTER TABLE tbxnproductcommentcriterion DISABLE KEYS */; /*!40000 ALTER TABLE tbxnproductcommentcriterioncategory DISABLE KEYS */; /*!40000 ALTER TABLE tbxnproductcommentcriterionlang DISABLE KEYS */; /*!40000 ALTER TABLE tbxnproductcommentcriterionproduct DISABLE KEYS */; /*!40000 ALTER TABLE tbxnproductcommentgrade DISABLE KEYS /; /!40000 ALTER TABLE tbxnproductcommentreport DISABLE KEYS */; /*!40000 ALTER TABLE tbxnproductcommentusefulness DISABLE KEYS /; /!40101 SET @OLDCHARACTERSETCLIENT=@@CHARACTERSETCLIENT */; /*!40101 SET @OLDCHARACTERSETRESULTS=@@CHARACTERSETRESULTS /; /!40101 SET @OLDCOLLATIONCONNECTION=@@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 AUTOINCREMENT,AUTOINCREMENT=2; /!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /!40101 SET CHARACTERSETRESULTS=@OLDCHARACTERSETRESULTS */; /*!40101 SET COLLATIONCONNECTION=@OLDCOLLATIONCONNECTION /; /!40000 ALTER TABLE tbxnproductcomment ENABLE KEYS /; /!40000 ALTER TABLE tbxnproductcommentcriterion ENABLE KEYS */; /*!40000 ALTER TABLE tbxnproductcommentcriterioncategory ENABLE KEYS */; /*!40000 ALTER TABLE tbxnproductcommentcriterionlang ENABLE KEYS */; /*!40000 ALTER TABLE tbxnproductcommentcriterionproduct ENABLE KEYS */; /*!40000 ALTER TABLE tbxnproductcommentgrade ENABLE KEYS /; /!40000 ALTER TABLE tbxnproductcommentreport ENABLE KEYS */; /*!40000 ALTER TABLE tbxnproductcommentusefulness ENABLE KEYS */;
0 x97wehner Posted October 9, 2017 Author Posted October 9, 2017 obviously this forum truncated the asterisks in the statements
0 lesley Posted October 9, 2017 Posted October 9, 2017 It looks like there was already a value in the table, if you are exporting just the content make sure the table is empty.
0 DaoKakao Posted October 9, 2017 Posted October 9, 2017 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
0 x97wehner Posted October 10, 2017 Author Posted October 10, 2017 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.
0 x97wehner Posted October 10, 2017 Author Posted October 10, 2017 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
Question
x97wehner
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?
14 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now