Last active
March 16, 2021 13:28
-
-
Save IlanVivanco/08a272f139efa6d1b11c7ca9997e0aed to your computer and use it in GitHub Desktop.
Replace serialized data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET | |
@search := 'https://website.com/wp-content/uploads/2019/10/the_original_image.jpg'; | |
--COLLATE utf8mb4_unicode_520_ci; | |
SET | |
@replace := 'https://website.com/wp-content/uploads/2019/10/the_new_image.jpg'; | |
--COLLATE utf8mb4_unicode_520_ci; | |
UPDATE | |
wp_postmeta | |
SET | |
meta_value = REPLACE( | |
meta_value, | |
CONCAT('s:', LENGTH(@search), ':"', @search, '"'), | |
CONCAT('s:', LENGTH(@replace), ':"', @replace, '"') | |
) | |
WHERE | |
meta_key = '_the_meta'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment