HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Replace String within Serialized data

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
serializedreplacewithindatastring

Problem

I am moving my forum from one domain to another and need to replace all instances of the previous domain with the new one. In looking at the mysql data, many of the matches are going to be in the middle of a serialized string, is there a quick way to replace all matches?

Solution

You're probably not still looking for an answer, but in case anyone else stumbles across this question.

This is an issue in WordPress development all the time. There's a tool built specifically for it by Interconnectit - https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

I've never tried it for anything other than WordPress, but it connects directly to the database using the standard user/pw info, so you should be able to connect it to any database. I think the only thing WordPress specfic is it auto-populates the database info.

It's quick and easy to use, and it deals with serialized strings so they don't become a hassle.

Context

StackExchange Database Administrators Q#64675, answer score: 5

Revisions (0)

No revisions yet.