Change domain Url in Wp mysql DB when cloning or moving app on a new domain
-
Dear all,
This is a feature request related to Wordpress, I don't know if keep post here or in "Feature request" area.
Cloning or migrating a Wordpress website to mydomain.tld to mynewdomain.tld requires also to change mydomain.tld to mynewdomain.tld in mysql database.
To do this, usually I use Better Search Replace plugin, and of course it takes more steps.
Could be interesting to integrate this kind of change while cloning or moving app via Cloudron web interface.
Now Cloudron customize domain in wp-config.php and could be interesting to have that change also in mysql database.
What do you think? Is a good idea?
Thank's a lot
-
Dear all,
This is a feature request related to Wordpress, I don't know if keep post here or in "Feature request" area.
Cloning or migrating a Wordpress website to mydomain.tld to mynewdomain.tld requires also to change mydomain.tld to mynewdomain.tld in mysql database.
To do this, usually I use Better Search Replace plugin, and of course it takes more steps.
Could be interesting to integrate this kind of change while cloning or moving app via Cloudron web interface.
Now Cloudron customize domain in wp-config.php and could be interesting to have that change also in mysql database.
What do you think? Is a good idea?
Thank's a lot
@p44 the config itself can be updated via
run.shif you enter those lines:mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} <<< "UPDATE wp_options SET option_value = '${CLOUDRON_APP_ORIGIN}' WHERE wp_options.option_name = 'siteurl';" mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} <<< "UPDATE wp_options SET option_value = '${CLOUDRON_APP_ORIGIN}' WHERE wp_options.option_name = 'home';"this however doesn't update your internal links which are often set absolute instead of relative, so you probably need search and replace after all.
-
@p44 the config itself can be updated via
run.shif you enter those lines:mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} <<< "UPDATE wp_options SET option_value = '${CLOUDRON_APP_ORIGIN}' WHERE wp_options.option_name = 'siteurl';" mysql --user=${CLOUDRON_MYSQL_USERNAME} --password=${CLOUDRON_MYSQL_PASSWORD} --host=${CLOUDRON_MYSQL_HOST} ${CLOUDRON_MYSQL_DATABASE} <<< "UPDATE wp_options SET option_value = '${CLOUDRON_APP_ORIGIN}' WHERE wp_options.option_name = 'home';"this however doesn't update your internal links which are often set absolute instead of relative, so you probably need search and replace after all.
-
@msbt Really interesting.
How to performe this action on ALL database, even internal links?
Do you think a feature that do this automatically, could be interesting to use when migrating-clone a WP instance?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login