Make sure to clean all the containers & volumes from the Docker desktop instance
Before we can upgrade the database we need to clean up data and make some preparations.
Follow these steps:
- Obtain a database dump of the production database from Firelay.
- Copy and rename the dump file over file /docker/resources/dump-liferay.sql (do not commit to github)
- In the file /docker/docker-compose.yml, comment out all services except for 'database'. This will assure that Liferay is not loaded.
- Start Docker by running the following command in the 'Terminal' panel from the project root folder!
./gradlew startLiferay
- Connect to the database using a DB viewer such as DBeaver.
jdbc:mariadb://localhost:3307/liferay
user: liferay, password: liferay
- Execute the SQL script /docker/resources/pre-upgrade-cleanup.sql.
- To make sure you can login after start execute the following SQL statement:
UPDATE User_ SET password_='your password here', passwordEncrypted=0 WHERE emailAddress='[email protected]';
- Go to table Configuration_ and select the SAML records:
SELECT * FROM Configuration_ WHERE configurationId LIKE 'com.liferay.saml%'
In the resultset update the 'dictionary' values. Set 'saml.enabled="false"' - Stop Docker by running the following command in the 'Terminal' panel from the project root folder!
./gradlew stopLiferay
Check that all containers have stopped and that the 'docker-compose.yml' file has been restored.
Run the following command in the 'Terminal' panel from the project root folder!
./gradlew startLiferay
This command will start the 'oss-liferay-74' container which will initiate the database upgrade. Open the container logs and make sure no errors occur.
First begin by logging into Liferay:
screen name=liferay, password='value entered in Step 2 - sub step 7
- Open Control Panel -> System Settings -> Search: JQuery. Check 'Enable JQuery' and save
- Open Control Panel -> System Settings -> Template Engines -> FreeMarker Engine
- Add 'nl.deltares.portal.utils.*' to Allowed Classes
- Remove staticUtil from list of Restricted Variables
- Remove objectUtil from list of Restricted Variables
- Remove serviceLocator from list of Restricted Variables
- Save changes
- Open Control Panel -> Service Access Policy -> SYSTEM_DEFAULT
- Add Service Class:
com.liferay.portal.kernel.service.GroupService
and Method Name:getGroup
- Add Service Class:
com.liferay.portal.kernel.service.LayoutService
and Method Name:getLayoutByUuidAndGroupId
- Save changes
Actions:
- Set theme to deltares-fews-theme. Make sure to copy the settings as they get lost when changing themes;
- google-tag-id
- page-footer-webcontent-id
- Shopping Cart
- show-cookies
- Clean the Velocity templates from oss.deltares.nl site
- Update template Carrousel-template
Actions:
- Set theme to deltares-theme. Make sure to copy the settings as they get lost when changing themes;
- google-tag-id
- page-footer-webcontent-id
- Shopping Cart
- show-cookies
- Update Footer.ftl
- Replace search results portlet with the Deltares search results portlet
- Add registration success page. Configure this page in the registration form
Actions:
- Set theme to deltares-theme. Make sure to copy the settings as they get lost when changing themes;
- google-tag-id
- page-footer-webcontent-id
- Shopping Cart
- show-cookies
- Update Footer.ftl
- Add download success page. Configure this page in the download form
company.default.web.id=liferay.com
This value must coincide with the 'webId' for the Company record of site 'oss.deltares.nl'template.engine.service.locator.restrict=false
Set this so the Servicelocator will return Deltares utilities classes
To ensure the IP addresses of users are passed to the Liferay backend, add a Valve to 'server.xml' configuration of Tomacat:
<Valve className="org.apache.catalina.valves.RemoteIpValve" internalProxies="10\.128\.0\.1|10\.129\.0\.1|10\.130\.0\.1" remoteIpHeader="x-forwarded-for" requestAttributesEnabled="true" protocolHeader="x-forwarded-proto" protocolHeaderHttpsValue="https"/>
Before sending DB Dump, test if it works by restoring the DB Dump into the database and check if errors occur.
Upgrading to 7.3 does not break nested structures Followed by upgrade to 7.4 results in the structures still containing content, however the nesting has been removed which causes (velocity) templates to get confused.
velocity seems not to be supported.
- gradle-local.properties is not being picked up by command ./gradlew startLiferay --updated build.gradle to load local properties explicitly - renamed config elasticsearch7 - After starting docker containers make sure Elastic configuration is set to REMOTE and path is set to http://elasticsearch:9200 - Re-index all item - jQuery is default turned off - switch on: System Settings -> Third Party -> JQuery -> enable - bump java version from 1.8 to 11 for both project and gradle - when switching between 7.1 and 7.4 gradle java version needs to be set manuallyJournalArticle content is no longer available when listener is triggered. Therefore JournalArticleListener no longer works. It is possible to override the onBeforeUpdate method instead. However we should rethink if these modules can be removed. The functionality is not being used.
- session type field renamed from 'type' -> 'registrationType'. Update if necessary for structures; SESSION, DINNER, BUSTRANSFER - Geolocation fields have been renamed; latitude -> lat, longitude -> lng - Deactivate all locals in structure fields that do not require translation. - Multiselect and single select fields do not work with Asset Publisher filtering options. Looks to be a bug. - Apparently this is a known issue: resolve by making sure the field is localizable - In old version Structures and Templates where named using a Key that needed to be inserted using SQL scripts. This is very difficult to manage and update. To avoid this problem we let Liferay create the keys and use configuration to map these to the internal key values. - When opening program item the '.header-back-to' appears and redirects to non-existing page. User main.css to set display: none - nested elements have automatically been converted to fieldsets. This needs to be changed for all templates. (eg. Footer.ftl) - security issues when accessing REST service as Guest user: Access denied to com.liferay.portal.kernel.service.GroupService#getGroup - Solution is to add to System_Default in Configuration->Service Access Policy of DSD site: - com.liferay.portal.kernel.service.GroupService#getGroup - com.liferay.portal.kernel.service.LayoutService#getLayoutByUuidAndGroupId For a number of purposes we need to map the IP addresses of users to a Country. For this we use the database 'GeoLite2-City.mmdb'. This file needs to be located in a folder that is accessible Liferay. The folder can be configured in: portal-ext.properties > maxmind.geoip.database.dir
Furthermore it allow tracking of user IPs in a container environment it is necessary to add a Valve to the 'server.xml' configuration of Tomcat
<Valve className="org.apache.catalina.valves.RemoteIpValve" internalProxies="10\.128\.0\.1|10\.129\.0\.1|10\.130\.0\.1" remoteIpHeader="x-forwarded-for" requestAttributesEnabled="true" protocolHeader="x-forwarded-proto" protocolHeaderHttpsValue="https"/>
Where the value for 'internalProxies' should be updated to match that of the google cloud environment.
As of u77 it is required that the properties file contains entry:company.default.web.id=liferay.com
This value must coincide with the 'webId' for the Company record of site 'oss.deltares.nl'
- Remove any existing volumes
- First deploy without themes and modules
- Check that the database upgrade processes complete successfully
- fix any errors that may arise by removing problem records from original database
- Enable JQuery options
To prepare the Liferay 7.1 database for the upgrade process, run the scripts defined in SQL file 'pre-upgrade-cleanup.sql'
that can be found in the docker/resources folder of this project.
- fix templates on the homepage of oss.deltares.nl:
- delete velocity templates and related structures
- create new Caroussel slides
- create new Front Page Contact in (Basic Web Content)
- Check if all countries available for companyId = 3948845
- Portlet options no longer visible: (https://help.liferay.com/hc/en-us/articles/12734525927565-Portlet-options-lost-after-upgrading-to-7-4-U51)
- update the package.json of theme:
"liferay-frontend-theme-styled": "6.0.63",
"liferay-frontend-theme-unstyled": "6.0.52"
- Ratings of ADT: can be set under Site Settings -> Community Tools -> Ratings