Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing "subdomain." prefix with empty string "" #32

Open
rivaros opened this issue Aug 19, 2021 · 2 comments
Open

Replacing "subdomain." prefix with empty string "" #32

rivaros opened this issue Aug 19, 2021 · 2 comments

Comments

@rivaros
Copy link

rivaros commented Aug 19, 2021

Have recently come across your wonderful script to cure Wordpress database copies between domains.

Have one more challenge - I just need to replace "staging." subdomain in all urls mentioned in sql file (including serialized PHP objects).

So replacement is just empty string (""). My wordpress installation is multi-site, so there are multiple subsiteX.maindomain.com urls as well as staging.subsiteX.maindomain.com on staging server.

While migrating from staging to production we need to delete away the "staging." subdomain.

@rivaros
Copy link
Author

rivaros commented Aug 19, 2021

@joshbetz In your code you check that replacement is at least 2 chars

                to = args[(i*2)+1]
		if !validInput(to, minOutLength) {
			fmt.Fprintln(os.Stderr, "Invalid <to>, minimum length is 2")
			os.Exit(3)
			return
		}

Could this be a problem if that check is removed?

@joshbetz
Copy link
Contributor

Can you replace staging.subsiteX.maindomain.com with subsiteX.maindomain.com?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants