WordPress.org

Ready to get started?Download WordPress

Forums

WP Migrate DB
[resolved] Messed up characters post migration (7 posts)

  1. clyphox
    Member
    Posted 2 years ago #

    Great plugin but I've experienced issues with characters being messed up on several migrations I've done.

    Examples (before/after) :

    strength and versatility
     strength and versatilityÂ

    S’s
    S’s

    offer – now!
    offer – now!

    ^^ Looking at these in raw HTML edit mode
    sql dumps pre and post available if you would like to examine them

    Otherwise its a great plugin and thanks

    http://wordpress.org/extend/plugins/wp-migrate-db/

  2. Devstorm
    Member
    Posted 2 years ago #

    so this plugin is presumably not UTF-8 compatible? this would be very problematic...

  3. clyphox
    Member
    Posted 2 years ago #

    I may need to do some tests to verify if this is maybe related to different collation on the DB itself :/ <throws hands up in air>

  4. ericson578
    Member
    Posted 2 years ago #

    drat, i'm running into character encoding issues too, otherwise great plugin.

  5. clyphox
    Member
    Posted 2 years ago #

    Yes I "think" the trick is to always ensure that your new wordpress databases always have the same character set/collation:

    CREATE DATABASE mydb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;

    Its still a mystery to me why the official wordpress installation docs exclude this. Maybe I'm wrong :/

    ericson, if you're still in a spot of trouple try this route:
    http://wordpress.org/extend/plugins/utf-8-db-converter/
    followed by creating the the new DB in utf etc:
    http://www.rhyous.com/2009/11/05/how-to-create-a-utf-8-unicode-database-on-mysql/

    -good luck

  6. clyphox
    Member
    Posted 2 years ago #

    What ever the issue with this plugin is I've just had to give up on it.
    I had to do an emergency migration and its totally fudged all the posts up again, I've at least had success the old fasioned way:

    mysqldump origdb > wp_orig.sql
    cp wp_orig.sql wp_new.sql
    perl -pi -e "s+old.domain.com+new.domain.com+g" wp_new.sql
    perl -pi -e "s+/public/sites/oldpath+/public/sites/newpath+g" wp_new.sql
    # assuming the destination DB and grants are ready just drop it and re_create it with the new variables
    mysql -e "drop database newdb;"
    mysql -e "CREATE DATABASE newdb DEFAULT CHARACTER SET utf8;"
    mysql -uliveusername -plivepassword newdb <~/wp_new.sql

    NB: the perl does a search/replace on a file..
    I also use it on all files containing matches.. so hard-coded .xml files for some plugins for example sometimes need this.

    To find a list of files that need changing:
    find /path/to/search -type f -exec grep -l <string> {} \;

  7. Brad Touesnard
    Member
    Plugin Author

    Posted 1 year ago #

    If you import the database using the mysql command, you should also set the --default-character-set=utf8 setting as well.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic