[Plugin: BackUpWordPress] WARNING truncates posts on import / restore
-
Great concept, unfortunately it seems to create ANSI files even when the WordPress database is encoded in UTF-8. This means that upon import of a backup, posts that contain certain special characters are truncated.
The developer’s site hasn’t been updated in two years. There is a forum but the registration page is not found. Below is the email that I sent last week; so far no reply. Hack at your own risk!
Mark Berry
MCB Systems
————————————–
I installed BackUpWordPress 0.4.5 under WordPress 2.9.2. It’s almost perfect for what I need, with one small problem: it creates corrupt database backups.Specifically, if a post contains certain special characters like ± or à, when I restore the database, the imported post is cut off at that character.
The problem seems to be that the data in the database is UTF-8, but the file created by BackUpWordPress is ANSI. You can see this if you open wordpress.sql in Notepad++ and check the encoding. (Possibly this is different on a German operating system?)
I think this may go back to PHP not having native support for UTF-8 (https://php.net/manual/en/language.types.string.php).
I’m not really a PHP programmer but looking at bkpwp-classes/manage_backups.php, perhaps if you would change line 693 to
if (!fwrite($handle, utf8_encode($sql))) {
the program would create UTF-8 files which could be imported without truncation.
I’ve tested this once and it does in fact create a UTF8 file. When I import that file using PhpAdmin, it works correctly–the special characters are included and the posts are not truncated. (By the way, I tried the database restore that is built in to BackUpWordPress a couple days ago and I couldn’t get it to work.)
This would need more testing to be sure that it works correctly.
…
- The topic ‘[Plugin: BackUpWordPress] WARNING truncates posts on import / restore’ is closed to new replies.