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 3.2.3.7 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? 


Thanks

James

Parents
  • 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.
    PK,
  • 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
    James
  • 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

    # BEGIN SUGARCRM RESTRICTIONS
    # 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>
    
    <IfModule mod_mime.c>
        AddType application/x-font-woff .woff
    </IfModule>
    <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>
    </FilesMatch>
    <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>
    <IfModule mod_headers.c>
            Header always set X-Frame-Options "SAMEORIGIN"
    </IfModule>
    # END SUGARCRM RESTRICTIONS
    

  • 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 

    {"error":"admin_only","error_message":"WARN_INSTALLER_LOCKED","url":"install.php"}

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

    Thanks

    James

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

Reply Children
No Data