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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Very bizarre issue with cloned app

    WordPress (Developer)
    5
    12
    240
    Loading More Posts
    • 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.
    • jdaviescoates
      jdaviescoates last edited by

      I migrated an instance of WordPress over to Cloudron to subdomain1.something.coop.

      I then backed it up and cloned it over to a new sub-domain subdomain2.something.coop

      Now, whenever any edits are made (or, not even made, as soon as one even goes into an edit screen) to a page on the WordPress all the links on the revert back subdomain1.something.coop, breaking all the link and images.

      WTF?

      I completely baffled as to what could be going one here?

      Any ideas?

      I use Cloudron with Gandi & Hetzner

      martinkbs 1 Reply Last reply Reply Quote 0
      • martinkbs
        martinkbs @jdaviescoates last edited by

        @jdaviescoates Is there any caching plugin active in the first instance before cloning the app?

        jdaviescoates 1 Reply Last reply Reply Quote 1
        • jdaviescoates
          jdaviescoates @martinkbs last edited by jdaviescoates

          @martinkbs no, no caching plugins are installed.

          I've tried using the Better Search and Replace plugin to replace all instances of subdomain1.something.coop to subdomain2.something.coop and that temporality fixes most (but seemingly not all) links.

          Look at this video. You should just be able to make out that the link I hover over is goop.development.coop (if you view full screen and look in bottom left corner) but then as soon as I edit the page and look at the exact same link somehow it's actually goopagain.development.coop (no idea why the video is so low res until the end)

          huh? 🤷

          Youtube Video

          I use Cloudron with Gandi & Hetzner

          imc67 martinkbs 2 Replies Last reply Reply Quote 0
          • imc67
            imc67 translator @jdaviescoates last edited by

            @jdaviescoates

            use this in the app CLI:

            wp search-replace https://domain1.coop https://domain2.coop --dry-run
            

            You see the dry run results, if there is something to change just do it again without --dry-run

            jdaviescoates 1 Reply Last reply Reply Quote 2
            • jdaviescoates
              jdaviescoates @imc67 last edited by

              @imc67 thanks, that is pretty much exactly what the Better Search and Replace plugin does, but it doesn't resolve the issue.

              I mean, I'll try this method too, but I'm willing to bet it won't make any difference...

              I use Cloudron with Gandi & Hetzner

              jdaviescoates 1 Reply Last reply Reply Quote 1
              • jdaviescoates
                jdaviescoates @jdaviescoates last edited by

                @imc67 yep, as I've already done that using the plugin, there were no cells to replace.

                But if I go to edit the homepage the links in the blocks are suddenly goopagain again. F-ing weird. It's almost like the block links aren't stored in the db or something.

                I use Cloudron with Gandi & Hetzner

                1 Reply Last reply Reply Quote 0
                • martinkbs
                  martinkbs @jdaviescoates last edited by

                  @jdaviescoates In principle, if you have followed the steps in Cloudron's WordPress migration guide (https://docs.cloudron.io/guides/migrate-wordpress/), you should not have any problems.

                  The command to replace urls has never given me any problems:

                  # sudo -E -u www-data /app/pkg/wp --path=/app/data/public/ search-replace 'https://old.cloudron.space' 'https://new.cloudron.space'
                  
                  # sudo -E -u www-data /app/pkg/wp --path=/app/data/public/ cache flush
                  

                  What can happen is that the destination url of the WordPress block is encoded in the database and the search-replace statement does not find it, for example:

                  https://goopagain.development.coop
                  

                  can be in the database as

                  https%3A%2F%2Fgoopagain.development.coop
                  

                  It is unusual, but on occasion it can happen.

                  jdaviescoates 1 Reply Last reply Reply Quote 2
                  • jdaviescoates
                    jdaviescoates @martinkbs last edited by

                    @martinkbs said in Very bizarre issue with cloned app:

                    In principle, if you have followed the steps in Cloudron's WordPress migration guide

                    I couldn't do that as it was a WordPress.com hosted WordPress site and unlike self-hosted WordPress you can't just simply download the export file (f-ing stupid, I know). Instead it emails a download link (and it emailed it to an email address I don't have access to).

                    @martinkbs said in Very bizarre issue with cloned app:

                    https%3A%2F%2Fgoopagain.development.coop

                    I think a search/ replace for just goopagain.development.coop (without any https:// nor https%3A%2F%2F) ought to still find that though, no?

                    I use Cloudron with Gandi & Hetzner

                    1 Reply Last reply Reply Quote 0
                    • jdaviescoates
                      jdaviescoates last edited by jdaviescoates

                      Well, I've no bloody idea what was going on there.

                      In the end I tried this:

                      1. Backing up (the broken) goop.development.coop
                      2. Saving the backup
                      3. Uninstalling goop.development.coop
                      4. Backing up goopagain.development.coop
                      5. Changing the location of goopagain.development.coop to goop.development.coop
                      6. Backing up again
                      7. Running wp search-replace goopagain.development.coop goop.development.coop in the Web Terminal for the app

                      Seem to now be working as expected! 😄

                      Literally have no idea why just cloning and doing a search/ replace didn't result in the exact same thing, but there you go. Bizarre.

                      I use Cloudron with Gandi & Hetzner

                      micmc 1 Reply Last reply Reply Quote 1
                      • robi
                        robi last edited by

                        What did you use to migrate the WP site?

                        May be wiser to start with a different approach from the get-go.

                        Life of Advanced Technology

                        1 Reply Last reply Reply Quote 1
                        • micmc
                          micmc @jdaviescoates last edited by

                          @jdaviescoates said in Very bizarre issue with cloned app:

                          Literally have no idea why just cloning and doing a search/ replace didn't result in the exact same thing, but there you go. Bizarre.

                          Might have something to do the settings of your permalinks.

                          At your first trial had you set them the same as they previously were on the original hosting platform?

                          Look at this closely next time, this is often what causes broken links issues. That's without knowing how you processed your migration at first from the old site.


                          https://marketingtechnology.agency
                          For cutting edge web technologies

                          1 Reply Last reply Reply Quote 0
                          • jdaviescoates
                            jdaviescoates last edited by jdaviescoates

                            I used the All in One Migration plugin that has always worked great before (but think this is the first time I've used it with a wordpress.com site)

                            And yeah, whilst I had saved permalinks on goopagain, perhaps a good ol' go hit save on permalinks over on goop might've done the trick 🤷

                            I use Cloudron with Gandi & Hetzner

                            1 Reply Last reply Reply Quote 1
                            • First post
                              Last post
                            Powered by NodeBB