Bug: The app is not responding after changing the location.
-
Hello,
First, thanks for your platform. I noticed that after changing the location from one domain to another,The app is not responding. After reading the log, I am seeing this error:
Verify DOMAIN_CURRENT_SITE matches an existing site or use `--url=<url>` to override
I put the app in recover mode and ran the search-replace command.
wp search-replace olddomain.com newdomain.staging.com
And I corrected wp-config.php for network installation.
So, it seems you aren't doing search-replace, which is essential.
Regards
-
So, it seems you aren't doing search-replace, which is essential.
Ideally yes, but in practice one cannot run that command without understanding the content of the app. What
search-replace
does is to replace strings in the database. This cannot be done by the platform because it changes things which may or may not be correct. For example, if you had a blog post in WP that said ,Man, I really loved my olddomain.com . olddomain.com was my love and passion but now I am forced to move to newdomain.staging.com
. Thatsearch-replace
will replace the strings in this blog post and it's all incorrect now. It's also possibleolddomain.com
is hosting some other external site now and you have links from the current WP to that. It's really context specific.I understand where you are coming from though. Many plugins and skins put all sorts of html and css with the full domain name in the database I don't know why.... This is something very WP specific.
-
I've always just used the Better Search and Replace plugin
-
@jdaviescoates This will not working as the container not responding
-
@BetterWP put this in your
run.sh
, that should make at least the homepage work after you restart the app, after that you can try to replace the other links manually/via plugin: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';"
-
-
@BetterWP This is not really a Cloudron issue but one you could face moving any WP installation to a different domain. WP is unfortunately very closely tied to the domain. You can do search replace on the database even if the app itself is down. You can also access the file system.