AlwaysSkint Posted October 29, 2020 Share I'm trying to import a database from osCmax using this addon but it gets stuck almost immediately. Quote The migration is in progress, please wait Oscommerce table_languages Item number : 1 No item to import, exist inside db : en table_products_description number_of_products : 28 663 - TEN Gel 3pk It (at least) reads the first product (with a description) from the 'old' database but doesn't continue. [29-Oct-2020 17:44:44 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in /home/clic/public_html/shop/includes/ClicShopping/OM/DbStatement.php:136 Stack trace: #0 /home/clic/public_html/shop/includes/ClicShopping/OM/DbStatement.php(136): PDOStatement->execute(NULL) #1 /home/clic/public_html/shop/includes/ClicShopping/OM/Db.php(374): ClicShopping\OM\DbStatement->execute() #2 /home/clic/public_html/shop/includes/Module/Hooks/ClicShoppingAdmin/ImportDatabase/Oscommerce.php(117): ClicShopping\OM\Db->save(':table_products...', Array) #3 /home/clic/public_html/shop/includes/ClicShopping/OM/Hooks.php(63): ClicShopping\OM\Module\Hooks\ClicShoppingAdmin\ImportDatabase\Oscommerce->execute(NULL) #4 /home/clic/public_html/shop/includes/ClicShopping/Apps/Tools/ImportData/Sites/ClicShoppingAdmin/Pages/Home/templates/import_process.php(80): ClicShopping\OM\Hooks->call('ImportDatabase', 'Oscommerce') #5 /home/clic/public_html/shop/ClicShoppingAdmin/index.php(41): include('/home/clic/publ...') #6 {main} in /home/clic/public_html/shop/includes/ClicShopping/OM/DbStatement.php on line 136 I've tried adding and deleting database tables prefix (something I don't normally use), in case that was the cause of "Invalid parameter" - that didn't help. Note: the installation instructions are not clear at all. I uploaded the images & includes directories to shop. I then added the apps_tools_import_data.json from ModuleInfosJson to ClicShopping/Work/Cache/Github. Is this correct? Quote Link to post
Foster Posted October 30, 2020 Share (edited) Hello It's long time I do not use this app. It's important to let the prefix table to be in concordance with ClicShopping Table About the installation : yes you must to to that. Could you make that : $this->db->save('products_description', $sql_data_array); by var_dump($sql_data_array); //$this->db->save('products_description', $sql_data_array); } } exit; What is the result ; Do you have 1 or 2 language or more ? Thank you. Edited October 30, 2020 by Foster 1 Quote Link to post
Drack Posted October 30, 2020 Share Hello, I think you must start on a fresh ClicShopping (not include inside your db the demo), Do you remember that @Foster ? Quote Link to post
AlwaysSkint Posted October 30, 2020 Author Share Hi, This is a fresh installation with no demo data loaded. (Was bad enough just to get the thing to run!) Importing a single language (en). There is no specific file for osCmax, even though it is listed in the dropdown. It'll try changing it in the Oscommerce.php file and select that one. Quote Link to post
AlwaysSkint Posted October 30, 2020 Author Share The section that you suggested doesn't exist; this is the closest that I could find: while ($data = $QproductDescriptions->fetch_assoc()) { foreach ($clicshopping_languages as $languages) { echo $data['products_id'] . ' - ' . $data['products_name'] . '<br />'; $sql_data_array = [ 'products_id' => (int)$data['products_id'], 'language_id' => (int)$languages['languages_id'], 'products_name' => $data['products_name'], 'products_description' => $data['products_description'], 'products_url' => $data['products_url'], 'products_viewed ' => (int)$data['products_viewed'], ]; // $this->db->save('products_description', $sql_data_array); } } Quote Link to post
AlwaysSkint Posted October 30, 2020 Author Share This has now allowed it to "import" (list) 28 products, plus display "1867 Address book". I need to check what has actually imported. Quote Link to post
AlwaysSkint Posted October 30, 2020 Author Share [30-Oct-2020 18:10:32 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column 'entry_zone_id' at row 1 in /home/clic/public_html/shop/includes/ClicShopping/OM/DbStatement.php:136 Stack trace: #0 /home/clic/public_html/shop/includes/ClicShopping/OM/DbStatement.php(136): PDOStatement->execute(NULL) #1 /home/clic/public_html/shop/includes/ClicShopping/OM/Db.php(374): ClicShopping\OM\DbStatement->execute() #2 /home/clic/public_html/shop/includes/Module/Hooks/ClicShoppingAdmin/ImportDatabase/Oscommerce.php(148): ClicShopping\OM\Db->save(':table_address_...', Array) #3 /home/clic/public_html/shop/includes/ClicShopping/OM/Hooks.php(63): ClicShopping\OM\Module\Hooks\ClicShoppingAdmin\ImportDatabase\Oscommerce->execute(NULL) #4 /home/clic/public_html/shop/includes/ClicShopping/Apps/Tools/ImportData/Sites/ClicShoppingAdmin/Pages/Home/templates/import_process.php(80): ClicShopping\OM\Hooks->call('ImportDatabase', 'Oscommerce') #5 /home/clic/public_html/shop/ClicShoppingAdmin/index.php(41): in /home/clic/public_html/shop/includes/ClicShopping/OM/DbStatement.php on line 136 [30-Oct-2020 18:12:41 UTC] PHP Notice: Undefined index: MessageStack_Data in /home/clic/public_html/shop/includes/ClicShopping/OM/MessageStack.php on line 35 [30-Oct-2020 18:12:41 UTC] PHP Notice: Undefined property: ClicShopping\Sites\Shop\Search::$checkManufacturer in /home/clic/public_html/shop/includes/ClicShopping/Sites/Shop/Search.php on line 408 Given the message stack error and manufacturer errors, I think I'll try a re-installation, from master. Quote Link to post
Foster Posted October 30, 2020 Share Hello, while ($data = $QproductDescriptions->fetch_assoc()) { .... Yes it was the line. but be careful check if all the data imported is the same that the original database. You can eventually have problem between products and products description inside your database (integrity) for example. About the last message, what you do, I do not understand exactly. Thank you. Quote Link to post
AlwaysSkint Posted October 30, 2020 Author Share Nothing was imported. :'( I'm not happy about the various error messages that are appearing in the error log, so I'm going to re-install clicshopping (again!). The instructions for installing aren't very good though, so it sometimes takes a few attempts. Quote Link to post
Patrick Posted October 31, 2020 Share I tried with oscommerce bd 2.3.3 and I have no problem. Just a little message a at end null .... I check the db and it's correct You can try this : Remove the french language and start a new install. Quote Link to post
ClicShopping Posted October 31, 2020 Share Split the installation in new post : https://www.clicshopping.org/forum/topic/1672-clicshopping-installation-problem/ 1 Quote Link to post
AlwaysSkint Posted October 31, 2020 Author Share 2 minutes ago, ClicShopping said: Split the installation in new post : https://www.clicshopping.org/forum/topic/1672-clicshopping-installation-problem/ Thanks, confused me for a bit. Especially as I created a new one.;) Quote Link to post
AlwaysSkint Posted November 2, 2020 Author Share I'm back at this migration. 🤪 Presumably, even though it's listed the osCmax migration code isn't included. I'm going to try copying the osCommerce.php to osCmax.php and rename the class within it, to osCmax. This way I can tweak the new file, to match up database files. Am I missing something? Quote Link to post
AlwaysSkint Posted November 2, 2020 Author Share (edited) A global search revealed this: $filename_array[] = array('id' => 'Oscommerce', 'text' => 'OscMax'); So my hunch was correct and this likely needs changed to match. The quest continues.. Blimey, this software has a convoluted/complex directory structure! Edited November 2, 2020 by AlwaysSkint Quote Link to post
AlwaysSkint Posted November 2, 2020 Author Share (edited) .. Got a custom osCmax migration, in development. There are various issues with the different database tables, though I do have the (simple) Categories one working. Some field names don't quite match up and date formats are throwing error, though I'm fairly hopeful that I'll get most of this fixed up. PHP Fatal error: Uncaught PDOException: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '0000-00-00 00:00:00' for column 'customers_dob' at row 1 in /home/clic/public_html/shop/includes/ClicShopping/OM/DbStatement.php:136 Edited November 2, 2020 by AlwaysSkint Quote Link to post
Patrick Posted November 2, 2020 Share (edited) Hello, this software has a convoluted/complex directory structure ==> When you do not know a software, it's always like that the first time You can create your own hooks and make that step by step. You have all the informations. I think it's better. In that case, you have not to change anything inside the apps. example. namespace ClicShopping\OM\Module\Hooks\ClicShoppingAdmin\ImportDatabase; use ClicShopping\OM\Registry; use ClicShopping\OM\HTML; use ClicShopping\OM\CLICSHOPPING; use ClicShopping\OM\Cache; use ClicShopping\Apps\Configuration\Administrators\Classes\ClicShoppingAdmin\AdministratorAdmin; use ClicShopping\Apps\Tools\ImportData\Classes\ClicShoppingAdmin\ImportDatabase; class MyOwnOscMax { ... } Edited November 2, 2020 by Patrick Quote Link to post
AlwaysSkint Posted November 2, 2020 Author Share (edited) Unfortunately that syntax is beyond me. 😞 I figured out all I had to do was remove the non-working osCmax reference and add my own osCmax.php, based on the Oscommerce one. At the moment, I'm trying to figure out the differences between HTML::outputProtected and HTML::sanitized Example: 'products_description' => HTML::outputProtected($data['products_description']), I'm trying to allow addresses with a # symbol (American's use it for number) and descriptions that include styles, as examples. (My comment stands on the complex directory structure - osCommerce is/was bad enough. ) Edited November 2, 2020 by AlwaysSkint Quote Link to post
Patrick Posted November 2, 2020 Share HTML::.... do not allow you to import whatever. First time you can use without and add security. for example HTML::sanitize replace some elements. See the function. 1 Quote Link to post
Foster Posted November 7, 2020 Share (edited) Hello @Patrick, HTML::.... do not allow you to import whatever. ====> Are you sure ? It's not better to say : HTML::sanitize do not allow you wathever. For example delete the tag <script> . I suppose that you want to tell us. Edited November 7, 2020 by Foster Quote Link to post
Patrick Posted November 7, 2020 Share Hello @foster, Yes you are right, that's I want to say. Quote Link to post
AlwaysSkint Posted November 7, 2020 Author Share (edited) Now that I have the store software running much better, I've had time to test migrations again. I wish I'd realised this tool is now included for free but don't regret the relatively little amount paid for it. Hey, at least it has given me something to work from. 🕵️♂️ I have an updated ImportDatabase.php Classes file that truncates many more tables, making migration considerably easier. I also have a new osCmax20.php (note the correct capitalisation) that is now on version 0.8 and is migrating a substantial amount of data now. Would you like these? What's the best/easiest way to get them to you? P.S. I'm using HTML::outputProtected now on some fields. Edited November 7, 2020 by AlwaysSkint typos :'( Quote Link to post
Patrick Posted November 7, 2020 Share Hello, You can create a fork on github, And It will be check, I suppose (include inside the app) Quote Link to post
AlwaysSkint Posted November 7, 2020 Author Share Re: purchase of the tool. Please ignore: I got confused by a similar one for a different cart. Re: github - never could get my head around that but can try, I guess. Used SVN in the past. Would be much easier to just post an attachment or provide an upload location eg. netxcloud. Quote Link to post
AlwaysSkint Posted November 7, 2020 Author Share (edited) 1 hour ago, Patrick said: Hello, You can create a fork on github, And It will be check, I suppose (include inside the app) I've managed to do something on github. 🤪 Can you merge the two branches and I might be able to add further updates, when available? Edited November 7, 2020 by AlwaysSkint 1 Quote Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.