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
-
@p44 the config itself can be updated via
run.sh
if 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 for me personally I wouldn't want that. When I use the clone feature, it clones an empty WP with a few basics installed to start the development process. When I migrate that to prod, I use duplicator, which does the heavy lifting and replacing.