Support » Fixing WordPress » mysql export – import

  • Hello

    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?

    sincerely
    Lars

Viewing 4 replies - 1 through 4 (of 4 total)
  • Mark (podz)

    (@podz)

    Support Maven

    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)

    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:
    –character-sets-dir=
    –default-character-set=

    sawtelle

    (@sawtelle)

    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.

    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.

    Adi

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘mysql export – import’ is closed to new replies.