Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. WordPress (Developer)
  3. Bug: The app is not responding after changing the location.

Bug: The app is not responding after changing the location.

Scheduled Pinned Locked Moved WordPress (Developer)
9 Posts 5 Posters 1.3k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BetterWP
    wrote on last edited by
    #1

    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

    girishG 1 Reply Last reply
    2
    • B BetterWP

      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

      girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by girish
      #2

      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 . That search-replace will replace the strings in this blog post and it's all incorrect now. It's also possible olddomain.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.

      B 1 Reply Last reply
      0
      • girishG girish

        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 . That search-replace will replace the strings in this blog post and it's all incorrect now. It's also possible olddomain.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.

        B Offline
        B Offline
        BetterWP
        wrote on last edited by
        #3

        Sorry, @girish I can't agree with you the search-replace after migration kind of WordPress rule. Otherwise, the container will be down.

        So, we need to respect WordPress rules.

        But thank you for your fast reply for sure 😊 👍

        1 Reply Last reply
        0
        • jdaviescoatesJ Offline
          jdaviescoatesJ Offline
          jdaviescoates
          wrote on last edited by
          #4

          I've always just used the Better Search and Replace plugin

          I use Cloudron with Gandi & Hetzner

          B 1 Reply Last reply
          1
          • jdaviescoatesJ jdaviescoates

            I've always just used the Better Search and Replace plugin

            B Offline
            B Offline
            BetterWP
            wrote on last edited by
            #5

            @jdaviescoates This will not working as the container not responding

            M 1 Reply Last reply
            0
            • B BetterWP

              @jdaviescoates This will not working as the container not responding

              M Offline
              M Offline
              msbt
              App Dev
              wrote on last edited by
              #6

              @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';"
              
              
              girishG 1 Reply Last reply
              1
              • M msbt

                @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';"
                
                
                girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by
                #7

                @msbt those are already updated by the package itself.

                    $wp option update siteurl "${CLOUDRON_APP_ORIGIN}"
                    $wp option update home "${CLOUDRON_APP_ORIGIN}"
                

                I think in the case of @BetterWP there is some plugin which is preventing the update of domain name.

                M 1 Reply Last reply
                0
                • girishG girish

                  @msbt those are already updated by the package itself.

                      $wp option update siteurl "${CLOUDRON_APP_ORIGIN}"
                      $wp option update home "${CLOUDRON_APP_ORIGIN}"
                  

                  I think in the case of @BetterWP there is some plugin which is preventing the update of domain name.

                  M Offline
                  M Offline
                  msbt
                  App Dev
                  wrote on last edited by
                  #8

                  @girish ah my bad, I use that in some LAMP WP's 😄

                  1 Reply Last reply
                  1
                  • C Offline
                    C Offline
                    ccfu
                    wrote on last edited by
                    #9

                    @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.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Bookmarks
                    • Search