Skip to content

<img> tags when moving db between servers #95

Open

Description

@mcheck

Is there a preferred method of managing the urls for images (and other assets) in posts and pages that have a full host and path, when they're moved between servers with, for instance:
cap staging genesis:down:db

When I run the above, my posts/pages all have the absolute staging url in all assets. Is there a workaround for this? Or a way we should be building link and assets references?

Activity

  1. added this to the v1.0.0 milestone on Jun 12, 2014
  2. EvanK commented on May 1, 2015

    @EvanK
    Contributor

    evolution/wordpress#37 has a (currently in-progress) fix for this, filtering the dumped sql file through perl to update urls for the target environment:

    https://github.com/evolution/wordpress/blob/35-url-constants/lib/capistrano/tasks/db.rake#L3

    Contingent on free time, I might try to backport this into Genesis

  3. mcheck commented on May 2, 2015

    @mcheck
    Author

    In Genesis, I implemented my own search-replace using awk, but it does not handle serialized values. So it potentially gets to be a mess. Works for the most part though.

    In Evolution, I added a cap task that uses wp-cli to change the values. It works great. Wp-cli search-replace handles all the serialization too. Brilliant you guys adding that to the project. My implementation is kinda hacky, because I couldn't figure out how to get the current name of the stage, and future name of the stage, but it's a good start.

  4. EvanK commented on May 3, 2015

    @EvanK
    Contributor

    Drat, I hadn't thought about serialized values.

    I would definitely prefer to use wp-cli over a perl invocation, but it only supports string replacements (for now: wp-cli/wp-cli#1600)

  5. mcheck commented on May 5, 2015

    @mcheck
    Author

    It's not as elegant but why wouldn't just string replacements work? My understanding is that we're just changing the stage.domain.tld portion of the urls.

    What else is being changed between envs that would require regex?

    On May 3, 2015, at 12:17 AM, Evan Kaufman notifications@github.com wrote:

    Drat, I hadn't thought about serialized values.

    I would definitely prefer to use wp-cli over a perl invocation, but it only supports string replacements (for now: wp-cli/wp-cli#1600)

    —
    Reply to this email directly or view it on GitHub.

  6. EvanK commented on May 5, 2015

    @EvanK
    Contributor

    My concern would be catching branched staging subdomains (custom-branch.staging.example.com), though on second thought the changes in evolution/wordpress#37 should make this a non-issue

  7. mcheck commented on May 6, 2015

    @mcheck
    Author

    Great! If there is someway I can help, don't hesitate to ask.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions