Broken images and attachments when moving to a new host

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wondertrout
    Junior Member
    • Apr 2022
    • 17

    Broken images and attachments when moving to a new host

    I have a working system and have backup up the database and moved all the files to a new host. I've confirmed I have the same PHP version, .htaccess file and adjusted the config-internal.php file with the correct database credentials. For some reason though, when I go to the login screen I have a broken image icon and I can't access attachments in the system once I've logged in. It seems there is some difference in play between the EspoUploadDir location that is breaking the migrated version in terms of upload directory.

    Does anyone have any insights as to where/how I can fix this when I move my system to a new host? I've followed the espo migration instructions to the letter and can't work out what possibly might be different!

    UPDATE: It seems to have something to do with the logic for ?entrypoint= which is returning a 404 not found error, despite the file being in exactly the same location, if that helps?
    Last edited by wondertrout; 09-12-2023, 05:17 AM.
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    #2
    did you check folder permissions? what is in the log-file? also the Apache (Server) log

    I have this quite often, not only when moving to another hoster but also when copying my modifications from staging to productive installations. I suspect, that might be some kind of a cache problem.
    Only I did not get it yet, where the problem could come from.

    Sometimes, when I delete a broken image that will be placed by formula, and then save the record, the image will be reconnected. Sometimes this does not work, though.
    Last edited by shalmaxb; 09-12-2023, 11:56 AM.

    Comment

    • wondertrout
      Junior Member
      • Apr 2022
      • 17

      #3
      Thanks shalmaxb I have checked file permissions and cleaned out the cache. The weird thing is, I created a new subdomain on the same new host and installed a fresh 7.x version and that works. I then upgraded that version to the same version as the source system and it still works. However, the copy of the old system on the same new host still shows a broken image logo and I can't access any documents that were uploaded. My hosting company can't (won't) investigate further because it is clearly an app issue with one subdomain working and another not.

      It does seem to be something to do with a path issue based on the ?entrypoint. There's a variable called EspoUploadDir and I'm assuming that could be the source of the problem but I'm not sure how to track it down from here. Any other suggestions from anyone would be most useful!​

      Comment

      • shalmaxb
        Senior Member
        • Mar 2015
        • 1602

        #4
        what did you copy from the old instance? Name all folders and files, please.

        Comment

        • wondertrout
          Junior Member
          • Apr 2022
          • 17

          #5
          shalmaxb I copied the entire root directory and all subdirectories - i.e., all files and folders, then edited the config.php and config-internal.php with new database and new path/siteURL. It does seem to have something to do with data/upload not being correctly recognised. What I can't work out is why a fresh instance works but this one doesn't. I've even tried copying over the working .htaccess file to the new site but it still is giving problems. Is there a way of displaying where it thinks data/upload is pointing to perhaps as this might help track it down.

          Comment

          • shalmaxb
            Senior Member
            • Mar 2015
            • 1602

            #6
            the path to my images looks this way: https://test.xxxxxx.com/?entryPoint=...687b1a754a3e5e
            it is also in a subdomain.
            Could you verify the formatting of your link and from your id, could you have a look in your folder data/upload if there is a file with that id. And to be sure, that the file is referenced correctly, could you verify this id present in the database, table attachments.

            Also look into your log-file and upload it here.

            Comment

            • wondertrout
              Junior Member
              • Apr 2022
              • 17

              #7
              Ok, so it's now working - but I can't exactly explain how or why. I did go back and review all of the settings and double checked that the files were in the correct upload directory. Just when I was about to give up in sheer frustration (given that a fresh install worked but the existing site being moved didn't) I tried again the following day and it all just worked. As I said, I can't quite explain it but must have been something being cached somewhere. Many thanks shalmaxb for your patience and willingness to help on this one. All of your advice was a great sanity check and was definitely a valuable contribution!!!!

              Comment

              Working...