WAMP local sugar from backup 404

Hi.  I'm trying to set up a local version of Sugar 11 from a cloud backup.    I'm fairly confident the prerequisites/requirements have been met (https://support.sugarcrm.com/Documentation/Sugar_Versions/11.0/Ent/Installation_and_Upgrade_Guide/#Installation_Prerequisites).  

I have a clean version of Sugar 11 on localhost which seems to work, I'm using WAMP 64-bit, PHP 7.3.21 (or 7.4.9) , MySQL 5.7.31, Apache 2.4.46, Elasticsearch 7.13.2. Chrome Version 91.0.4472.124 (Official Build) (64-bit). 

I've followed the instructions from https://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_10.3/Integration/Migration/Migrating_From_Sugar_Cloud_to_On-Site/  and when I try to access the install I get the 'Loading...' box and an error in the console "Failed to load resource: the server responded with a status of 404 (Not Found) at <backupSugar>/rest/v11_12/metadata/public?type_filter=&platform=base&module_dependencies=1  

I've cleared the browser cache and the Sugar cache folder and reloaded. Does anyone have any idea how to fix this? 



  • Hi James,

    Please go through this link to know more about the Sugar Identity Service.

    For the instances running on Sugar cloud and using the Sugar Identity, when you have deployed the backup of that instance on your local machine, you have to execute the below query in your local DB.

    UPDATE config SET value =0 WHERE category = 'idm_mode' AND name = 'enabled';

    Once this is done, clear your contents in the cache folder of your SugarCRM root directory.

    Make sure your SugarCRM root directory is having proper ownership and permissions.

    Clear your browser cache and login to the instance and check.

    Hope this helps.
  • Thanks for replying.  I ran that query 

    UPDATE config SET value =0 WHERE category = 'idm_mode' AND name = 'enabled'

    0 rows affected. (Query took 0.0003 seconds.)
    I still deleted the cache folder and tried to open Sugar but still get the same endless 'Loading' with the 404 in the console.
    I've then deleted the db and repeated steps 3 and 4 of the migration instructions and checked the config table for idm_mode and nothing is returned:-

    SELECT * FROM `config` WHERE category = 'idm_mode'

    MySQL returned an empty result set (i.e. zero rows). (Query took 0.0003 seconds.)
    I've checked the GET /rest/v11_4/metadata/public response from the cloud sandbox and it shows "idmModeEnabled": true
    Is there anything else I can try?
    Thanks again
  • Can you check if there is a .htaccess file in your root www directory? That is most of the time the issue I'm facing when I get a 404 on the rest api calls. See example below

    # Fix mimetype for logo.svg (SP-1395)
    AddType     image/svg+xml     .svg
    AddType     application/json  .json
    AddType     application/javascript  .js
    <IfModule mod_rewrite.c>
        Options +FollowSymLinks
        RewriteEngine On
        RewriteBase /
        RewriteRule (?i)\.git - [F]
        RewriteRule (?i)\.log$ - [F]
        RewriteRule (?i)^bin/ - [F]
        RewriteRule (?i)^cache/diagnostic/ - [F]
        RewriteRule (?i)^composer\.(json|lock)$ - [F]
        RewriteRule (?i)^cron\.php$ - [F]
        RewriteRule (?i)^custom/blowfish/ - [F]
        RewriteRule (?i)^dist/ - [F]
        RewriteRule (?i)^emailmandelivery\.php$ - [F]
        RewriteRule (?i)^files\.md5$ - [F]
        RewriteRule (?i)^src/ - [F]
        RewriteRule (?i)^upload/ - [F]
        RewriteRule (?i)^vendor/(?!ytree.*\.(css|gif|js|png)$) - [F]
        RewriteRule (?i)^(cache|clients|data|examples|include|install|jssource|metadata|ModuleInstall|modules|soap|xtemplate)/.*\.(php|tpl)$ - [F]
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^rest/(.*)$ api/rest.php?__sugar_url=$1 [L,QSA]
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^cache/api/metadata/lang_(.._..)_(.*)_public(_ordered)?\.json$ rest/v10/lang/public/$1?platform=$2&ordered=$3 [N,QSA,DPI]
        RewriteRule ^cache/api/metadata/lang_(.._..)_([^_]*)(_ordered)?\.json$ rest/v10/lang/$1?platform=$2&ordered=$3 [N,QSA,DPI]
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^cache/Expressions/functions_cache(_debug)?.js$ rest/v10/ExpressionEngine/functions?debug=$1 [N,QSA,DPI]
        RewriteRule ^cache/jsLanguage/(.._..).js$ index.php?entryPoint=jslang&module=app_strings&lang=$1 [L,QSA,DPI]
        RewriteRule ^cache/jsLanguage/(\w*)/(.._..).js$ index.php?entryPoint=jslang&module=$1&lang=$2 [L,QSA,DPI]
        RewriteRule ^portal/(.*)$ portal2/$1 [L,QSA]
        RewriteRule ^portal$ portal/? [R=301,L]
    <IfModule mod_mime.c>
        AddType application/x-font-woff .woff
    <FilesMatch "\.(jpg|png|gif|js|css|ico|woff|svg)$">
            <IfModule mod_headers.c>
                    Header set ETag ""
                    Header set Cache-Control "max-age=2592000"
                    Header set Expires "01 Jan 2112 00:00:00 GMT"
    <IfModule mod_expires.c>
            ExpiresByType text/css "access plus 1 month"
            ExpiresByType text/javascript "access plus 1 month"
            ExpiresByType application/x-javascript "access plus 1 month"
            ExpiresByType image/gif "access plus 1 month"
            ExpiresByType image/jpg "access plus 1 month"
            ExpiresByType image/png "access plus 1 month"
            ExpiresByType application/x-font-woff "access plus 1 month"
            ExpiresByType image/svg "access plus 1 month"
    <IfModule mod_headers.c>
            Header always set X-Frame-Options "SAMEORIGIN"

  • Thanks very much Jeroen.  I've updated the .htaccess with that, I'd previously just used the one linked in the migration doc, the only change I've made was adding the local site in the RewriteBase /sandbox-westlindsey-S11  , I then cleared browser cache / emptied the sugar cache folder and tried again... the 404 error is now gone from the console :D but the page still isnt reaching a login.  

    These are the remaining warnings:-

    DevTools failed to load source map: Could not load content for localhost/.../jquery-migrate.min.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

    DevTools failed to load source map: Could not load content for localhost/.../gridstack-extra.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

    DevTools failed to load source map: Could not load content for localhost/.../gridstack.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

    DevTools failed to load source map: Could not load content for localhost/.../single-spa.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

    sugar_sidecar.min.js?v=IbCf8P7o26LAbD83krvzeA:2043 singleSpa.start() has not been called, 5000ms after single-spa was loaded. Before start() is called, apps can be declared and loaded, but not bootstrapped or mounted. See https://github.com/CanopyTax/single-spa/blob/master/docs/single-spa-api.md#start

    I've just tried localhost/sandbox-westlindsey-S11/rest/v11/help and rather than 404 it now gives back 


    It seems so close!  Is there anything else I can try?



  • Hi.  I've set the config.php 'installer_locked' => true,  I double checked the enabled modules in Apache, I disabled and then re-enabled rewrite_module, cleared cache etc and I now can access localhost/.../help  , but the login screen still is stuck.

  • I know you have put a lot of work into this already but if you are still at a point where its not working you might want to look into the Vagrant setup.  I did everything manually for all my developers in the past but now we all converted over to the Vagrant setup and it works great and requires almost no setup, just installing 2 programs and running a command line.  If you need help just ask.

  • Hi Kenneth.  It's getting to that point... 

    I did have a clean development 10.3 copy running on Vagrant, although found I couldn't add fields with the module builder and the quick repair was far from 'quick' which was why I started down the wamp route in the first place. 

    I've fired up vagrant again and when I go to http://localhost:8080/sugar/  the installer kicks in ('installer_locked' => false).  Do you know if its possible to run a backup on Vagrant?

  • The adding of fields in module builder APPEARS to be a bug, and a long standing one at that.  I sent in a case for it but I still don't know if its got a bug report yet.  Nothing to do with Vagrant though.

    I use a script for repairs so the speed difference isn't so great as my dev envirnment (phpstorm) kicks it off when its needed and just clears the cache if thats all thats needed.

    I have my DB on a copy of MySQL outside of Vagrant as the VM doesnt have the disk space for our DB.  If thats what you mean by backup then yes it is possible.

    I have had problems off and on installing a clean system, it works 75% of the time.   But directing it to use a copy of my production database works every time.

  • Thanks again. By "backup" I mean a copy of our cloud instance including the existing customisations rather than a fresh install. After starting Vagrant http://localhost:8080/sugar goes straight to an installer (but wont proceed with 'installer_locked' => true), if I understood correctly at this point a backup should go straight to the login screen, could you elaborate on how to achieve that please?

  • Hi James,

    You have to change the 'installer_locked' => false in the config.php file and try restoring the instance again. For more information go through this link.

    Hope this information helps.

    Thanks & Regards,

    Poojitha K