Page 1 of 5 123 ... LastLast
Results 1 to 10 of 44
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,403
    Plugin Contributions
    87

    Default Database Conversion Tools [Support Thread]

    This plugin's been around for a while (https://www.zen-cart.com/downloads.php?do=file&id=2367) and deserves its own support thread!

    I've just submitted v4 to the Plugins area. That version also checks the overall database collation and, if it's not currently utf8, makes that conversion, too!

    The previous versions of this plugin only focused on converting the table-based collations. If a database started with a collation of latin1_general_ci, for instance, the previous versions would properly convert all the database tables to use utf8_general_ci but leave the overall collation unchanged.

    The next time a new table is added to that database, that table and all character fields within it would default to the database's default: latin1_general_ci. Not a good thing!
    Last edited by swguy; 16 Aug 2023 at 03:26 PM. Reason: Updated URL of converter plugin

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,403
    Plugin Contributions
    87

    Default Re: Convert Database to UTF8 (convert_db2utf8) [Support Thread]

    v4 is now available for download from the Plugins.

  3. #3
    Join Date
    Feb 2012
    Posts
    27
    Plugin Contributions
    0

    Default Re: Convert Database to UTF8 (convert_db2utf8) [Support Thread]

    Hi

    I have latin1 and utf8 tables in my database, is this module ok to use on this?

    Regards

    Mike

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,403
    Plugin Contributions
    87

    Default Re: Convert Database to UTF8 (convert_db2utf8) [Support Thread]

    Quote Originally Posted by mike14017 View Post
    Hi

    I have latin1 and utf8 tables in my database, is this module ok to use on this?

    Regards

    Mike
    Yes, that's the problem that this module solves! The plugin's processing will convert the database, all tables and their fields to utf8 ... just remember to update your configure.php files (both admin and storefront) to identify that the database's DB_CHARSET is now utf8 instead of latin1.

    You should also change the CHARSET definition in your store's base language files (e.g. /includes/languages/english.php, /YOUR_ADMIN/includes/languages/english.php) to reflect a utf8-type character encoding.

  5. #5
    Join Date
    Feb 2012
    Posts
    27
    Plugin Contributions
    0

    Default Re: Convert Database to UTF8 (convert_db2utf8) [Support Thread]

    Hi

    Done all that and converted DB. Everything seems fine.

    What a cracking module, thank you.

    Mike

  6. #6
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,668
    Plugin Contributions
    1

    Default Re: Convert Database to UTF8 (convert_db2utf8) [Support Thread]

    Thanks for a great tool Cindy - fast and seamless.

    cheers,
    Mike

  7. #7
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,403
    Plugin Contributions
    87

    Default Re: Convert Database to UTF8 (convert_db2utf8) [Support Thread]

    Quote Originally Posted by shags38 View Post
    Thanks for a great tool Cindy - fast and seamless.

    cheers,
    Mike
    Mike, it's a collaborative effort ... with the primary thanks going to @a_berenzin (original author) for the idea and the base processing. Additional changes by @mc12345678 and myself were simply adding "frosting to the cake" to improve its processing.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,403
    Plugin Contributions
    87

    Default Re: Convert Database to UTF8 (convert_db2utf8) [Support Thread]

    I've just submitted v1.2-lat9 for the plugin moderators' review and will post back here when it's available for download.

    This version, split from the plugin's base GitHub repository, adds the quotes required around text-fields' default values and now makes use of the site's database settings present in the associated /includes/configure.php.

  9. #9
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,625
    Plugin Contributions
    123

    Default Re: Convert Database to UTF8 (convert_db2utf8) [Support Thread]

    Approved.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,403
    Plugin Contributions
    87

    Default Re: Convert Database to UTF8 (convert_db2utf8) [Support Thread]

    Houston, we have a problem.

    It's never 'fun' upgrading a previous site to zc157, especially when the database contains the dreaded mixed collations. I've had the pleasure of updating a couple of sites that started with a mixture of various flavors of latin1 and utf8 and adopted the following procedure for those upgrades.

    1. Change the site's configure.php files, setting DB_CHARSET to 'latin1'.
    2. Run /zc_install/sql/install/zero_dates_cleanup.sql. Make sure it's the updated version of that script which uses the MySql CAST function.
    3. Run /zc_install to upgrade the site's database.
    4. Run the (older) convert_db2utf8.php script.
    5. Change the site's configure.php files, setting DB_CHARSET to 'utf8'.
    6. Run the utf8mb4_conversion.php script.
    7. Change the site's configure.php files, setting DB_CHARSET to 'utf8mb4'.


    All was going well, until I added a plugin whose installation adds a table which includes one or more character (i.e. 'char' or 'varchar') fields. When that table was added, it and its fields' collations were set to 'utf8mb4_unicode_520_ci'. Unfortunately, while the pre-existing tables' collations were set to 'utf8mb4_unicode_520_ci', those tables' fields were set to 'utf8mb4_general_ci'. When a SQL query that binds the newly-added table to a pre-existing one, I was met with:

    HP Fatal error: 1267:Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_520_ci,IMPLICIT) for operation '='

    I was able to correct the issue by logging into the site's webhost and, using phpMyAdmin's Operations tab, changing the collation of the database, all tables and all table fields to utf8mb4_general_ci.

 

 
Page 1 of 5 123 ... LastLast

Similar Threads

  1. v155 Database I/O Manager (DbIo) Plugin [Support Thread]
    By lat9 in forum Addon Admin Tools
    Replies: 475
    Last Post: 23 Feb 2024, 05:44 PM
  2. Hebrew Support - latest release [Support Thread]
    By eranariel in forum Addon Language Packs
    Replies: 19
    Last Post: 23 Jan 2023, 08:04 AM
  3. v156 PWA, Offline support Push notifications addon [Support Thread]
    By perfumbg in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 May 2019, 02:27 PM
  4. v155 Database Server Info [Support Thread]
    By lat9 in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 20 Jan 2017, 01:17 PM
  5. Rate conversion in paypal non-support currency
    By limcheewooi in forum PayPal Express Checkout support
    Replies: 1
    Last Post: 7 Jul 2009, 03:13 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR