mysql export - import (5 posts)

  1. larsfarm
    Posted 11 years ago #


    A backup is a backup IF and ONLY IF the restore works.

    1) I export from the wordpress/mysql as xml or sql dump via phpMyAdmin. I get either an xml or SQL text file.

    2) I import in my local system

    All tables, all data is there except that "ÅÄÖåäö" and various chars >127 are wrong. Consequently all swedish text is garbled. The restore fails.

    It seems that the extended chars are UTF-8 in the file, but the exported file is not a vaild UTF-8 text file. At least that's what BBEdit/Textwrangler claims when it opens the file. The three last letters in the alphabet ( åäö ) are there, but so are various &#nnn chars that shouldn't be. When I later lok at the resutl through the local WordPress also the åäö are gone.

    What's wrong?
    How do I solve this problem?


  2. Mark (podz)
    Support Maven
    Posted 11 years ago #

    Check what it is being exported as, and check what the character properties of the database are into which you are importing.

    You could also look at something like Notepad++ which will save as utf-8 as well. (I don't use a mac)

  3. e-head
    Posted 11 years ago #

    You may want to try exporting/importing by "hand". That is, using the command line, instead of phpAdmin.

    The problem could be with phpAdmin.

    To do this from the command line:

    mysqldump -u root -p wordpress > dotsandloops.net.sql

    mysql -p wordpress < dotsandloops.net.sql

    If that doesn't work, try these options:

  4. sawtelle
    Posted 10 years ago #

    Moving from mysql 4.x to 5.x just adding --skip-opt to the mysqldump worked for me. The postings only had simple use of curly quotes, mdashes & etc. though. In another mysql application using utf-8 text I achieved clean export/import only by changing text fields to blob, export, import, and then changing the blob fields back to text. The body content of http://www.columbia.edu/kermit/utf8.html is a good sample to use as a test for successful utf-8 export/import process.

  5. adieyal
    Posted 9 years ago #

    I concur with sawtelle. I just changed my post_content and post_title fields to longblob and blob respectively - exported,imported and changed them back and every thing seems display correctly.

    If anyone is interested
    Before Export:
    ALTER TABLE wp_posts
    CHANGE post_content post_content LONGBLOB NOT NULL ,
    CHANGE post_title post_title BLOB NOT NULL

    and After Import:
    ALTER TABLE wp_posts
    CHANGE post_content post_content LONGTEXT NOT NULL ,
    CHANGE post_title post_title TEXT NOT NULL

    There may be other fields that need changing but those were the two that I needed.


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.