Follow

wordpress help 

I had put a semi-automated backup process in place yesterday.

Today's goal was to restore the backup locally and satisfy myself against the saying "you don't have backups unless you've tested restoring from them."

Which brings me to... the fact that the emojis render as "?" everywhere.

database export was made using `wp db export` if that helps?

What's wrong? How can I fix this?

wordpress help 

The HTML source also looks like this:

<a href="rusingh.com/blog/">? Blog</a>

wordpress help 

@celia Review the routes in your local instance. if you use WP-CLi you can do a search and replace of the path of your domain by the url of your local environment.

wordpress help 

@lordvalor I can fix the paths. The emojis are a problem though, the example source was just to demonstrate what the emoji looks like in the source code, sorry! 😅

wordpress help 

@celia it's because data is stored within the database and it munges things up if you're using utf8. To have emojis work, you need to use utf8mb4.

Having said the above, I've never been able to get it to work successfully when doing an import, so I've just reduced the number of emojis I use instead.

This explains it more - j11g.com/2019/07/12/about-word

wordpress help 

@kev honestly, what a mess.

Have you ever tried this? mas.to/@SkinnyFeels/1060191916

wordpress help 

@celia by encoding your DB in urf8mb4 and ensuring your export is encoded the same way, it should work.

Problem I have is that I use Plesk on my web server, and it uses standard utf8 when creating a new DB, so it always messes up. There is a work around, but I haven't got around to implementing it yet.

wordpress help 

@celia just thinking aloud here...wondering if, as well as a “proper” backup, it’s worth installing something like WP2Static and have it generate a static version of the site, then offload that somewhere. That way, there’s no DB and in a disaster (hopefully that won’t happen) you will have a like for like version of your site that you can publish.

You then have the formatted content, which should make fixing WP DB easier.

wordpress help 

@kev Noted, WP captain! 😁

I'll explore this too.

wordpress help 

@celia I don't know anything about wordpress, but it sounds like an encoding issue; maybe it has an option to save or restore backups as UTF-8 instead of whatever it's defaulting to?

wordpress help 

@sam knackered for today but @SkinnyFeels brought this to my attention and this should fix it I think: mas.to/@SkinnyFeels/1060191916

wordpress help 

@celia @SkinnyFeels I'll keep my fingers crossed for you, good luck!

wordpress help 

@celia looks like an encoding issue; I’d check if the character coding system settings in the db you imported to match the original (presumably both should be UTF-8)

wordpress help 

@jamesnvc thanks! @SkinnyFeels raised this thread which seems helpful mas.to/@SkinnyFeels/1060191916

I'll test this tomorrow. 🤞🏼

wordpress help 

@celia

wp db export --default-character-set=utf8mb4

apparently.

Source: github.com/wp-cli/db-command/i

wordpress help 

@SkinnyFeels This did the trick! 🎉

wordpress help 

@celia awesome. Good work!

Sign in to participate in the conversation
Fosstodon

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.