Skip to content

Specify Key value when Search and Replace in Serialized Data #105

Description

@adampatterson

I came across the scenario of moving my S3 bucket and while doing that also changed the path.

I upload an image, It is sent to Kraken.io, and Uploaded to S3 using Media Offload.

I made a copy locally of the database and ran wp search-replace 'old-bucket 'new-bucket. To my joy, the serialized string was also updated.

My next task was to update the media path. Previously it would have been old-bucket/year/month

Now it would be new-bucket/media/year/month

If I were to search and replace based off of /2015 I am going to affect the _wp_attached_file and _wp_attachment_metadata

Is it possible to search inside of two columns where one column value is equal to something else?

Like look in meta_value where meta_key == amazonS3_info?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions