The MU forums have moved to WordPress.org

bbWP2UTF8 plugin to fix weird characters issue (convert database to utf8) (9 posts)

  1. BjornW
    Member
    Posted 14 years ago #

    Hi,

    I just released a plugin called bbWP2UTF8 to automatically convert a MySQL database character set to UTF8.

    It aim is to solve issues regarding weird characters popping up, usually after an upgrade has been done from a no-utf8 using wordpress mu (as far as I know 1.2.5 and previous versions) to a version which uses utf8.

    Download it from http://wordpress.org/extend/plugins/bbwp2utf8/ where you can also find more detailed information of how it should be installed and how it works. I hope it's useful and welcome feedback and patches.

  2. Konstan
    Member
    Posted 14 years ago #

    I tried this plugin, activated and all. But when I click on the plugin's name it will either load a blank page, or ask me to download wpmu-admin.php

    Any ideas why?

  3. Konstan
    Member
    Posted 14 years ago #

    Ok, I upped the memory limit in php.ini, but this script wont work for me because my db has over 25k tables.

    The script has been working for a whole hour (according to top, mysql was being used), but it wont load anything. I guess I'll have to try something else :(

  4. BjornW
    Member
    Posted 14 years ago #

    Konstan,

    I have used this plugin on big databases, but not as big as 25.000 tables. I recommend to select a limited set of tables to perform on, see if the tables have been transformed and then continue with the ones not transformed yet. This might solve the problem for you. Please let me know if this solved your problem.

  5. Konstan
    Member
    Posted 14 years ago #

    How would I do that?

  6. Ovidiu
    Member
    Posted 14 years ago #

    try this plugin, seems to do the same thing?
    http://g30rg3x.com/utf8-database-converter/

    this one might also give you some help: http://kaloyan.info/blog/wp-utf8-sanitize-plugin/

  7. BjornW
    Member
    Posted 14 years ago #

    @Ovidiu: my experience is that the plugins you've mentioned do not work with Wordpress Mu.

    @Kostan: I wonder if the plugin isn't just working. Perhaps it is taking a long time, but I would not be surprised with 25.000 tables.

    You can check if the plugin works by making sure you don't get a PHP error (don't forget to check your php error log, especially when display_errors is off ;) ).

    Also you can check if columns of tables are being transformed to their binary counterparts. You can check this by using mysql admin or phpmyadmin to check columns of tables and see if they have been transformed from their textual type to their binary counterparts.

    From the README:

    "After you have selected the tables for conversion and pressed the button *convert columns to binary counterparts for checked tables* the plugin will go through all tables and look for columns of the type: char, varchar, tinytext, text, mediumtext, longtext, enum and set. Columns of these types will be converted to their binary counterparts according the list below:

    - char --> binary
    - varchar --> varbinary
    - tinytext --> tinyblob
    - text --> blob
    - mediumtext --> mediumblob
    - longtext --> longblob

    As you might have noticed the column types enum and set are not changed to a different type, instead the plugin will set those columns character set to binary."

    If columns are being transformed I would like to ask you to let the plugin run for a while (transformation of a 250 tables database took me in total about 5 min, so yours could in total take approx. 8hrs).

    I hope this helps.

  8. Konstan
    Member
    Posted 14 years ago #

    I ended up dumping the original database using -–default-character-set=latin1, then running a convert via command line and then reimport the new db into the new server.

    It worked, although I suspect the characters will go fubar once I try to backup it normally again.

    I'll test after I get the multi-db working, because of the size of my database it takes a long time to dump or run this script. Once its divided into 16 db it should be easier. Maybe I'll even go 256.

  9. BjornW
    Member
    Posted 14 years ago #

    Ok, good luck with the multi-db. Are you going to use HyperDB for that?

    I'm very curious about the plugin in relation to huge datasets, so please do let me know your experience when you get the chance to test it.

About this Topic