Repository navigation
fix: wpdev golive accepts a bare host and validates the URL before copying the DB - #7
Open
derhofbauer wants to merge 1 commit into
Open
derhofbauer wants to merge 1 commit into
derhofbauer wants to merge 1 commit into
Conversation
…pying the DB parse_url() has no host key for a scheme-less argument, so 'wpdev golive preview.inlingua.at 6' died with "Could not parse" after the golive copy had already been created and the local admin deleted. Prepend https:// when the scheme is missing, and parse/validate both URLs before any data is touched. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ddev wpdev golive 'preview.inlingua.at' 6failed with:parse_url()returns nohostkey for a scheme-less argument, so a barehost was rejected. Worse, the URL was parsed after the
golivedatabase hadalready been created, copied, and the local admin deleted — a bad URL left the
golivecopy half-migrated (andddev dbsync goliveaborts before itscleanup, leaving the copy behind).
Fix (
commands/web/wpdev,cmd_golive)https://when the production URL has no scheme, so bare hosts work.Verification
Against a live project (inlingua-website):
ddev wpdev golive 'preview.inlingua.at' 6now completes: devadmin deletedfrom the copy, 4488 posts reassigned to user 6,
siteurlrewritten tohttps://preview.inlingua.at/, localdbuntouched.ddev dbsync golive 'preview.inlingua.at' 6produces the gzipped export in.ddev/.wpdev/and drops thegolivedatabase afterwards.bash -npasses; the diff is identical to the fix verified in the project.