Upgraded from 7.12.7 to 8.2.0

Below are my apahce and .htaccess settings addresses in upgrade documentation.

apache config 
        DocumentRoot /var/www/suitecrm-8/public/legacy

  Options +SymLinksIfOwnerMatch
    Options -Indexes
    Options -MultiViews
    RewriteEngine On
    RewriteBase /legacy/
    RewriteRule ^cache/jsLanguage/(.._..).js$ index.php?entryPoint=jslang&modulename=app_strings&lang=$1 [L,QSA]
    RewriteRule ^cache/jsLanguage/(\w*)/(.._..).js$ index.php?entryPoint=jslang&modulename=$1&lang=$2 [L,QSA]

    # --------- DEPRECATED --------
    RewriteRule ^api/(.*)$ - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteRule ^api/(.*?)$ lib/API/public/index.php/$1 [L]
    # -----------------------------

    RewriteRule ^Api/(.*)$ - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteRule ^Api/access_token$ Api/index.php [L]
    RewriteRule ^Api/V8/(.*?)$ Api/index.php [L]


DocumentRoot should be public, not public/legacy

Did you really find a documentation page where this is incorrect?

You are correct it doesn’t match the docs. I appreciate your patients and thanks for continuing responding and help me.

I tried “public” in apache root path, but I don’t even get a logon screen. I only get a white screen.

First block is what is loaded when going to site and the second is from the browser developer console.

<!DOCTYPE html><html lang="en"><head>
    <meta charset="utf-8">
    <title>SuiteCRM</title>
    <base href="">

    <meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="pragma" content="no-cache">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">

    <link rel="manifest" href="site.webmanifest">
    <link rel="icon" type="image/x-icon" href="dist/themes/suite8/images/favicon.ico">
<style>:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;}*,:after,:before{box-sizing:border-box;}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent;}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff;}body{height:100%;margin:0;padding:0;border:none;background:#f5f5f5;}</style><link rel="stylesheet" href="dist/styles.2e454321d37da21c8384.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="dist/styles.2e454321d37da21c8384.css"></noscript></head>

<body>
<app-root></app-root>
<script src="dist/polyfills-es5.a796944d1aa555108e9a.js" nomodule defer></script><script src="dist/polyfills-es2015.94f9c56150490143c73a.js" type="module"></script><script src="dist/scripts.fd0065da857a983220ad.js" defer></script><script src="dist/main-es2015.cc95f31b9093f62d18df.js" type="module"></script><script src="dist/main-es5.cc95f31b9093f62d18df.js" nomodule defer></script>

</body></html>
node_modules_angular_core_fesm2015_core_js-es2015.e67882692b6d3d658f6b.js:1 ERROR Error: Http failure response for http://crm.wavecrestcomputing.com/api/graphql: 404 Not Found
    at new t (node_modules_apollo-angular_fesm2015_ngApollo_js-_0ddc0-es2015.31fc3a06fac668918939.js:1:35812)
    at node_modules_apollo-angular_fesm2015_ngApollo_js-_0ddc0-es2015.31fc3a06fac668918939.js:1:66628
    at r (node_modules_apollo-angular_fesm2015_ngApollo_js-_0ddc0-es2015.31fc3a06fac668918939.js:1:33160)
    at node_modules_apollo-angular_fesm2015_ngApollo_js-_0ddc0-es2015.31fc3a06fac668918939.js:1:33086
    at new P (polyfills-es2015.94f9c56150490143c73a.js:1:18300)
    at Object.then (node_modules_apollo-angular_fesm2015_ngApollo_js-_0ddc0-es2015.31fc3a06fac668918939.js:1:33053)
    at Object.error (node_modules_apollo-angular_fesm2015_ngApollo_js-_0ddc0-es2015.31fc3a06fac668918939.js:1:33170)
    at v (core_app_shell_src_bootstrap_ts-es2015.376068f61f1fb7ece8f1.js:1:165870)
    at _ (core_app_shell_src_bootstrap_ts-es2015.376068f61f1fb7ece8f1.js:1:166366)
    at t.error (core_app_shell_src_bootstrap_ts-es2015.376068f61f1fb7ece8f1.js:1:166919)

White page is probably a 500 error breaking the code on the server-side.

Check the .htaccess RewriteBase options, according to docs.

Remember there may be different .htaccess files in different directories, don’t just change one at random.

Sorry pgr but the documentation is not clear.
I have exactly the same problem, I followed the guide, but it is not clear how to configure:
a) what should be the document root, public or public/legacy?
b) what is in each case the correct setting for RewriteBase, and .htaccess related files in different folders?
c) which part of the folder the app suitecrm need to reach? suitecmr8, suitecrm/public or suitecrm8/public/legacy ?

If in the document is not written the logic behind things, it is difficult for people to understand how to setup.

My 2 cents.

1 Like

Hi @cicciobello,

Thank you for your feedback.

regarding you questions above, I hope the following might help:

a) Ideally it should point /path-to-suitecrm/public. There is some more info on the 1.3 Configuring URL re-writes guide

b) It should be something line. (I need to update the documentation there is an error there, thank you for highlighting it)

  • RewriteBase

    • If you have your vhost pointing to public dir within the SuiteCRM 8 root folder. Then you should set RewriteBase /legacy

    • Otherwise, you should prepend the path until the public folder.

      • e.g. if your address is something like https://your-host/crm/public , then you should set RewriteBase /crm/public/legacy

c) not entirely sure what you mean. Though on the browser the app “runs” on the <suitecrm8-folder>/public. So if your vhost is pointing to <suitecrm8-folder>/public, then on the browser you just need to access https://your-vhost-name

Hope this helps.

PS: I may not be able to reply back in a reasonable timeframe… sorry…

Hi @clemente.raposo everything is clear now, thank you.
so:
path-to-suitecrm contains private files that must not be exposed to internet
path-to-suitecrm/public contains files that everyone can reach, like path-to-suitecrm/public/robots.txt
path-to-suitecrm/public/legacy contains the true application (coming from 7.12.8) and if there is some call to a .js file, we need to drive it through index.php in legacy subdirectory. For doing this we need to rewrite the URL that comes from 7.12.8 installation forcing to go through the new path that contains “legacy”.

Did I understand correctly?
Thank you very much now the system is working!

HI,
i don’t mean to hijack the thread - but i agree the documentation is not clear.

I finally have the migration working, however the legacy pages all appear to lack css.
I believe this is caused by the rewrite settings?

However but using RewriteBase /legacy when the vhost points to the public folder doesn’t work for me.


Did you set in .htaccess the directives to make rewrite work?
they are

<Directory /var/www/suitecrm8/public> (or similar)
AllowOverride All
Order Allow,Deny
Allow from All

Hi cicciobello,
yes that’s what i have in vhost. This is what i have :-

Server 1
	<VirtualHost *:80> 	
		ServerName crm.mydomain.co.uk	
		ProxyPass / http://192.168.1.1/
		ProxyPassReverse / http:// 192.168.1.1/
	</VirtualHost>
Server 2  IP: 192.168.1.1
	<VirtualHost *:80>
		DocumentRoot /var/www/crm8/public
		<Directory /var/www/crm8/public>
			AllowOverride ALL
			Order Allow,Deny
			Allow from All
		</Directory>
	</VirtualHost>

   /var/www/crm8/public/legacy/config.php:
       'site_url' => 'http://crm.mydomain.co.uk/',

   /var/www/crm8/public/legacy/.htaccess:
        <IfModule mod_rewrite.c>
            Options +SymLinksIfOwnerMatch
            Options -Indexes
            Options -MultiViews
            RewriteEngine On
            RewriteBase /legacy
            RewriteRule ^cache/jsLanguage/(.._..).js$ index.php?entryPoint=jslang&modulename=app_strings&lang=$1 [L,QSA]
            RewriteRule ^cache/jsLanguage/(\w*)/(.._..).js$ index.php?entryPoint=jslang&modulename=$1&lang=$2 [L,QSA]
        
            # --------- DEPRECATED --------
            RewriteRule ^api/(.*)$ - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
            RewriteRule ^api/(.*?)$ lib/API/public/index.php/$1 [L]
            # -----------------------------
        
            RewriteRule ^Api/(.*)$ - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
            RewriteRule ^Api/access_token$ Api/index.php [L]
            RewriteRule ^Api/V8/(.*?)$ Api/index.php [L]
        </IfModule>


Just try to set .htaccess in public, not only in public/Legacy.

I have set It up this way, and It works.

Hi @Bungle ,

The issue that you describe really looks like something related with the .htaccess.

could you seen the full .htaccess, leaving out any sensitive data.

I’m assuming you’ve deployed using the pre-built packages that are on the website and not a dev environment pulled from github

Hi @cicciobello,

Regarding the following post:

  • Yes
  • Yes
  • Yes and no.
    • It contains the legacy app. SuiteCRM 8 has a full SuiteCRM 7 within it. At the moment SuiteCRM 8 still relies on SuiteCRM 7 for a good part of the backend functionality. But the Frontend is almost all on the SuiteCRM 8 side under /core/app
      • There is an exception though, which we call the classic views. SuiteCRM 8 can display views for modules as they displayed in SuiteCRM7, using the same MVC model. This is driven by configuration, meaning you can choose which views for which modules you want to display in classic view mode.
      • The goal of classic views is to allow backwards compatibility on legacy views with heavy customization.
  • For classic views this is true. Classic views will fully render using public/legacy. Suite 8 views do not call public/legacy for getting js files or css.

Hope this helps

1 Like

@cicciobello - unfortunately no luck adding to the public .htaccess

@clemente.raposo

Here is the public .htaccess :

# Use the front controller as index file. It serves as a fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex index.php

# By default, Apache does not evaluate symbolic links if you did not enable this
# feature in your server configuration. Uncomment the following line if you
# install assets as symlinks or if you experience problems related to symlinks
# when compiling LESS/Sass/CoffeScript assets.
# Options FollowSymlinks

# Disabling MultiViews prevents unwanted negotiation, e.g. "/index" should not resolve
# to the front controller "/index.php" but be rewritten to "/index.php/index".
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /legacy
    RewriteRule ^index.php.*$ - [L,NC]

    # Determine the RewriteBase automatically and set it as environment variable.
    # If you are using Apache aliases to do mass virtual hosting or installed the
    # project in a subdirectory, the base path will be prepended to allow proper
    # resolution of the index.php file and to redirect to the correct URI. It will
    # work in environments without path prefix as well, providing a safe, one-size
    # fits all solution. But as you do not need it in this case, you can comment
    # the following 2 lines to eliminate the overhead.
    RewriteCond %{REQUEST_URI}::$0 ^(/.+)/(.*)::\2$
    RewriteRule .* - [E=BASE:%1]

    # Sets the HTTP_AUTHORIZATION header removed by Apache
    RewriteCond %{HTTP:Authorization} .+
    RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0]

    # Redirect to URI without front controller to prevent duplicate content
    # (with and without `/index.php`). Only do this redirect on the initial
    # rewrite by Apache and not on subsequent cycles. Otherwise we would get an
    # endless redirect loop (request -> rewrite to front controller ->
    # redirect -> request -> ...).
    # So in case you get a "too many redirects" error or you always get redirected
    # to the start page because your Apache does not expose the REDIRECT_STATUS
    # environment variable, you have 2 choices:
    # - disable this feature by commenting the following 2 lines or
    # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
    #   following RewriteCond (best solution)
    RewriteCond %{ENV:REDIRECT_STATUS} =""
    RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]

    # If the requested filename exists, simply serve it.
    # We only want to let Apache serve files and not directories.
    # Rewrite all other queries to the front controller.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ %{ENV:BASE}/index.php [L]
</IfModule>

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>
        # When mod_rewrite is not available, we instruct a temporary redirect of
        # the start page to the front controller explicitly so that the website
        # and the generated links can still be used.
        RedirectMatch 307 ^/$ /index.php/
        # RedirectTemp cannot be used instead
    </IfModule>
</IfModule>

Here is the public/legacy .htaccess :

# BEGIN SUITECRM RESTRICTIONS
<IfModule mod_rewrite.c>
    Options +SymLinksIfOwnerMatch
    Options -Indexes
    Options -MultiViews
    RewriteEngine On
    RewriteBase /legacy
    RewriteRule ^cache/jsLanguage/(.._..).js$ index.php?entryPoint=jslang&modulename=app_strings&lang=$1 [L,QSA]
    RewriteRule ^cache/jsLanguage/(\w*)/(.._..).js$ index.php?entryPoint=jslang&modulename=$1&lang=$2 [L,QSA]

    # --------- DEPRECATED --------
    RewriteRule ^api/(.*)$ - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteRule ^api/(.*?)$ lib/API/public/index.php/$1 [L]
    # -----------------------------

    RewriteRule ^Api/(.*)$ - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteRule ^Api/access_token$ Api/index.php [L]
    RewriteRule ^Api/V8/(.*?)$ Api/index.php [L]
</IfModule>
<IfModule mod_headers.c>
    Header unset ETag
    FileETag None
</IfModule>
<IfModule mod_headers.c>
    Header unset X-Powered-By
    Header always unset X-Powered-By
</IfModule>
<IfModule mod_expires.c>
 ExpiresActive on
 ExpiresDefault "access plus 1 month"

 # CSS
 ExpiresByType text/css "access plus 1 year"

 # Data
 ExpiresByType application/atom+xml "access plus 1 hour"
 ExpiresByType application/rdf+xml "access plus 1 hour"
 ExpiresByType application/rss+xml "access plus 1 hour"
 ExpiresByType application/json "access plus 0 seconds"
 ExpiresByType application/ld+json "access plus 0 seconds"
 ExpiresByType application/schema+json "access plus 0 seconds"
 ExpiresByType application/geo+json "access plus 0 seconds"
 ExpiresByType application/xml "access plus 0 seconds"
 ExpiresByType text/calendar "access plus 0 seconds"
 ExpiresByType text/xml "access plus 0 seconds"

 # Favicon
 ExpiresByType image/x-icon "access plus 1 week"

 # HTML
 ExpiresByType text/html "access plus 0 seconds"

 # JavaScript
 ExpiresByType application/javascript "access plus 1 year"
 ExpiresByType application/x-javascript "access plus 1 year"
 ExpiresByType text/javascript "access plus 1 year"

 # Markdown
 ExpiresByType text/markdown "access plus 0 seconds"

 # Media files
 ExpiresByType audio/ogg "access plus 1 month"
 ExpiresByType image/bmp "access plus 1 month"
 ExpiresByType image/gif "access plus 1 month"
 ExpiresByType image/jpeg "access plus 1 month"
 ExpiresByType image/jpg "access plus 1 month"
 ExpiresByType image/png "access plus 1 month"
 ExpiresByType image/svg+xml "access plus 1 month"
 ExpiresByType image/webp "access plus 1 month"
 ExpiresByType video/mp4 "access plus 1 month"
 ExpiresByType video/ogg "access plus 1 month"
 ExpiresByType video/webm "access plus 1 month"

 # Fonts
 ExpiresByType font/eot "access plus 1 month"
 ExpiresByType font/opentype "access plus 1 month"
 ExpiresByType font/otf "access plus 1 month"
 ExpiresByType application/x-font-ttf "access plus 1 month"
 ExpiresByType font/ttf "access plus 1 month"
 ExpiresByType application/font-woff "access plus 1 month"
 ExpiresByType application/x-font-woff "access plus 1 month"
 ExpiresByType font/woff "access plus 1 month"
 ExpiresByType application/font-woff2 "access plus 1 month"
 ExpiresByType font/woff2 "access plus 1 month"

 # Other
 ExpiresByType text/x-cross-domain-policy "access plus 1 week"
</IfModule>
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
</IfModule>

# END SUITECRM RESTRICTIONS

Obvious question, Sorry but just to be sure, do you have mod_rewrite Activated in apache?

yes i have mod-rewrite enabled.

I’ve also noticed a strange behaviour:-

The home, menu item and profile icons show correctly when i first log in (see first image below) and stay present while viewing various pages.

However, if the page is refreshed these icons disappear (second image below). I can log out and back in, still no icons.

They only re-appear after logging out and refreshing the page ‘before’ logging back in.

Icons show correctly:

After refresh they dissapear:

And did you try to reach directly your internal server without passing through the proxy? For example using an internal dns server or better modifying the /etc/hosts of your client?

The same happens?

yes the same thing happened when omitting the proxy.

However!

How random - i noticed the page redrawing itself almost instantly, so wondered if there was anything in the legacy/custom folder causing the issue.

I removed the legacy/custom folder and it loaded up correctly !!
I then copied the legacy/custom folder back into place and its working!

I’m so pleased - appreciate the help :slight_smile:

Hi!

I seem to have the same symptoms like you have. For example the home-image does not exist: /legacy/themes/default/images/home.png
doing a search for the home.png-file, this is what i get
public/legacy/themes/default/images/jjwg_Markers/home.png

Documentroot in apache is correct (DocumentRoot /foo/bar/suite8/public) and rewritebase is RewriteBase /legacy/

I tried with removing the custom-folder, no joy. I have also run repairs (Quick, all js-related, dashlets), still the formatting is missing.

Hey Hertell,

Did you eventually get it right? I’ve got the same problems and I’m stuck at the moment.

Thanks,
Tom