title: Updating serialized data from a Wordpress database
body: <p>I moved a WordrPress website from one server and domain to another, but into the database I still have the old paths and I want to update them to the new values. The real problem is that the content I need to change is serialized, so I cannot do a global find and replace like:
  <code>http://my-old-domain.com/</code> replaced with <code>http://my-newest-domain.com</code> because I have to replace things like this:</p>
  
  <p><code>s:755:\"&lt;img class=\"size-medium\" src=\"http://my-old-domain.com/esthetique/wp-content/uploads/2019/01/logo-fundal-300x64.png\" ...</code></p>
  
  <p>to</p>
  
  <p><code>s:755:\"&lt;img class=\"size-medium\" src=\"http://my-newest-domain.com/esthetique/wp-content/uploads/2019/01/logo-fundal-300x64.png\" ...</code></p>
  
  <p><code>newest</code> has 6 characters while <code>old</code> had 3 characters, so all the <code>s:...</code> part needs to be increased with 3. I could do this manually, but there are 1470 places where this needs to be changed and the <code>s:...</code> part takes different values.
  Can you please advise if there is an easy way to do this? I cannot change by hand all of them. Thanks!</p>