Character encoding issues after restoring a managed backup

I used Snapshot Pro to restore a managed backup on a site that had a virus problem (it was caused by a plugin, and I corrected everything).

The site was not accessible, because of the virus entered from the backdoor that plugin created. So I had to restore it manually, uploading the archive and the script through FTP.

So then I ran the steps on snapshot wizard and it succeded. The only problem is that the backup, once restored, messed up pretty much all the text on the site (and also some other minor things, like the header color, it reset the logo, and other things, but those are not important).

The main problem is that there seems to be an issue with the character encoding. Any words with accent were changed with other characters, and so I have all the site that looks like someone typed words randomly… any idea on how to solve that?

  • Adam Czajczyk
    • Support Gorilla

    Hello Matteo

    I hope you’re well today and thank you for your question!

    Issues like this one usually happen if the character encoding in a new database is different than it was set in the original one. However, since the characters are already “messed up” in the database itself, simply switching encoding won’t help much here so we’d need to try to re-import data to the database again, making sure that the encoding gets set properly and/or it’s converted.

    You have provided db and site access during the chat so that’s great but could you please also let me know which of the Managed Backups (I can currently see 5 of them on “Snapshot -> Managed backups page in your site’s back-end) is the one to be used for restoration? Normally I’d use the latest one but it’s from today so it also probably includes those changed characters and for the older ones – I don’t know which one would be the one from before the infection.

    Let me know please and I’ll see if we could fix it up that way.

    Kind regards,

    Adam

  • Matteo
    • Site Builder, Child of Zeus

    Hi Adam,

    Sorry, i was really in a rush so i have restored the database through different means, using the support of my hosting provider.

    Actually the problem still reamins for future restoration though.

    It always happens with snapshot. During the chat it was showed to me another post with similar problems like mine, and the people there solved the problem changig the snapshot-installer.php file.

    I think the solution is there, but i have no coding skills..

  • Adam Czajczyk
    • Support Gorilla

    Hello Matteo

    Thank you for letting me know and I’m sorry for the late response.

    I’ve run a number of restorations over time both from “snapshots” and “managed backps” via wp-admin and using snapshot-installer.php and I never personally experienced the issue but I’m aware it does exist. It seem it doesn’t happen always – just needs some specific “circumstances” to happen but we had reports like that, I confirm. The issue was also reported to our developers though I can also say that in general the “scale” of the issue is smaller than it seems and I think the delay with update is because they are actually working on a hole new and much improved snapshot engine. But I’m absolutely sure that will be fixed.

    Meanwhile:

    1) I’d like to run some more tests on my end (as it might help our developers to e.g. releases some patch or minor update fixing just this issue) so could you please remind me what exactly is/was the character encoding used in your new database (the one that you restored the site to)? I usually go for “utf8_general_ci” and this works fine for me, though on the other hand I think I had that luck that the source dbs was also using that. Let me know about it please.

    2) I’ve also attached modified snapshot-installer.php file (in zip archive) to this post for you; it includes the fix suggested by one of our Members in other ticket so you might want to give it a try (e.g. some test-drive by restoring to some temporary/staging site) to see if it works for you.

    Best regards,

    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.