Sie sind auf Seite 1von 19

R18A_Hybris_Migration_Guide

Version: 1.0
Date: 07/11/2017
R18A_Hybris_Migration_Guide

Revision History
Release/ Description Author
Date Version
AM

2017-10-02 1.0 R18A First version Simone Busacca

Client approval / sign-off


Date Name Title Signature

[XXX] [XXX] [XXX] [XXX]

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 1
R18A_Hybris_Migration_Guide

Index
1 Executive summary ...............................................................................................................................................3
2 Context .................................................................................................................................................................. 4
2.1 Purpose of the Document .............................................................................................................................4
2.2 Intended Audience ........................................................................................................................................4
2.3 Definitions .....................................................................................................................................................4
3 Prerequisites ..........................................................................................................................................................5
3.1 Check properties ...........................................................................................................................................5
4 Migration guide ......................................................................................................................................................6
4.1 Server deploy ................................................................................................................................................6
4.2 Update Running System ...............................................................................................................................7
4.3 Run the procedures .sql to clean the DB ....................................................................................................11
4.4 Start the server ...........................................................................................................................................11
4.5 Full system update (90 min) .......................................................................................................................11
4.6 Post update sys procedures .......................................................................................................................12
4.7 Deploy other modules .................................................................................................................................14
4.8 Run SQL script............................................................................................................................................14
4.9 Remove cache ............................................................................................................................................15
4.10 Check synchronization job configuration ....................................................................................................15
4.11 Run Solr index ............................................................................................. Error! Bookmark not defined.
4.12 Run Apptus export ......................................................................................................................................16
4.13 Server deploy (Phase 2) .............................................................................................................................17
4.14 Check availability ........................................................................................................................................17
5 Remove Solr and unused Jobs ............................................................................... Error! Bookmark not defined.
4.15 Solr jobs ....................................................................................................... Error! Bookmark not defined.
4.16 Unusued Jobs .............................................................................................. Error! Bookmark not defined.
5 Notes ...................................................................................................................................................................17
5.1 Dependency of the steps ............................................................................................................................17
5.1.1 SQL Developer connection .....................................................................................................................17
5.1.2 Rolling cluster instructions ....................................................................... Error! Bookmark not defined.

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 2
R18A_Hybris_Migration_Guide

1 Executive summary

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 3
R18A_Hybris_Migration_Guide

2 Context
2.1 Purpose of the Document
The goal of this document is to show all the steps needed to migrate R17D Hybris Installation to the R18A one based
on the Hybris platform 6.2.0.11.

All the steps listed below are mandatory to enable instantiation functionality.

2.2 Intended Audience


Accenture Development Team / Accenture internal use only.
The intended reader is expected to some experience with Hybris and deploying platforms.

2.3 Definitions
All the abbreviations used in the document are listed in the below table:

Term Definition

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 4
R18A_Hybris_Migration_Guide

3 Prerequisites

ONLY FOR LOCAL ENVIRONMENT


LOCAL DB CLONE

dump_db.sql

Example of above:

example R9DatabaseCopy.txt

3.1 Check properties -


1. In the GIT repo - go to GOEP_ENV and check that the correct properties are set correctly for the instance
you are deploying:
a. instance.name (EU/EU2/AM/AP according instance)
b. environment.name (DEV/SYT/INT/PRD according environment) -- Q
c. instance.master (true in EU instance, false in AM/AP)
d. planningMarkets (hm-europe/hm-europe2/hm-america/hm-asia according instance)
e. task.engine.loadonstartup is set true on ADMIN nodes and missing in ECM local.properties
f. cluster.node.groups is set with following value impCronJobGroup, cronjobGroup, --Q-
fulfillmentProcessingGroup, processingGroup (at least one of admin node has to have one of listed
values)
2. Check dbtype.properties is properly set on config folder (same level of local.properties) and it is same of
production one
3. Check “Jms queue configuration” properties are not present in local.properties and make sure they are
on the server before the deploy

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 5
R18A_Hybris_Migration_Guide

4 Migration guide
PAY ATTENTION:
1. All cybersource, paypal, gift card, p24 and ACI merchant properties have to be copied on proper
instance (TA activity) -
2. Check solr config is properly loaded (TA activity) -
3. Check Apache rules are properly updated (TA activity) -
4. Check hybris patch (TA activity) -

4.1 Stop all servers -


Run deploy with start option set to “STOP” and run the script on all instances (EU1, EU2, AM and AP) from sql
developer:-

4.2 Remove all stocks movement on MongoDB (not needed in


local environment) -
1. Connect to HYBOMS<ENV><INST>01. (again, check with TA team the name) (zhybomsapcww01)
2. Open the com.hybris.oms_oms-rest-webapp.properties file located in App/Tomcat/lib on the server.
3. Retrieve MongoDB server list saved on properties (property stock.persistence.engine.mongodb.url)
4. Retrieve MongoDB database name (property stock.persistence.engine.mongodb.databaseName)
5. Retrieve MongoDB user name / password (property stock.persistence.engine.mongodb.url). These
properties are found in the beginning of the string.
6. Connect to each server found in the list and run the command “mongo” until you find the one that gives
the response containing “PRIMARY”

7. Then run the following commands:


a. use <DATABASE_NAME>
b. db.auth(“<USERNAME>”, “<PASSWORD>”)
c. db.movement.remove({})
d. db.movement.find()

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 6
R18A_Hybris_Migration_Guide

4.3 Server deploy -


*Please note: all the options that are not specified below must keep their default values.
1. Find the correct instance on Jenkins.
2. Press the menu option “Build with parameters”.
3. Chose the ENV/NAME, DeployBuild and instance.
4. Set RESTART_SERVER to “STOP”
5. Start the deploy

4.4 Update Running System

4.4.1 PRELIMINAR FIXES TO DO IN THE DATABASE:-

4.4.1.1 Check the ydeployments table for all the tenants (master included)

Execute this query:


 SELECT * FROM ydeployments WHERE NAME = 'Link' AND PACKAGENAME =
'de.hybris.platform.persistence.link';
The result is ONE row. Check if the value for the column EXTENSIONNAME equals core. If not, execute the
following update
 UPDATE ydeployments SET EXTENSIONNAME = 'core' WHERE TABLENAME = 'links' AND NAME =
'Link' and SUPERNAME = 'de.hybris.platform.persistence.ExtensibleItem';

run the following query.


 SELECT * FROM ydeployments WHERE TABLENAME = 'product2media';
if one result is retrieved, no action required. Otherwise execute the insert statement below
 Insert into YDEPLOYMENTS
(HJMPTS,TYPECODE,TABLENAME,PROPSTABLENAME,NAME,PACKAGENAME,SUPERNAME,EXTE
NSIONNAME,MODIFIERS,TYPESYSTEMNAME) values
(null,20135,'product2media','props','appcore_Product2Media','de.hybris.platform.persistence.link','de.hybris
.platform.persistence.link.Link','appcore',2,'DEFAULT');

Commit the changes.

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 7
R18A_Hybris_Migration_Guide

4.4.1.2 Check the table PROPS

Check if the table PROPS follows this structure:

Name Null Type

HJMPTS NUMBER(20)

ITEMPK NOT NULL NUMBER(20)

ITEMTYPEPK NOT NULL NUMBER(20)

NAME NOT NULL VARCHAR2(255 CHAR)

LANGPK NOT NULL NUMBER(20)

REALNAME VARCHAR2(255 CHAR)

TYPE1 NUMBER(20)

VALUESTRING1 VARCHAR2(4000)

VALUE1 BLOB

If not, this must be recreated. Use the following commands:

Rename the props table

 alter table PROPS


rename to PROPS_OLD;

Create a new props table with the columns in the correct order

 CREATE TABLE PROPS


AS (SELECT HJMPTS, ITEMPK, ITEMTYPEPK, NAME, LANGPK, REALNAME, TYPE1,
VALUESTRING1, VALUE1
FROM PROPS_OLD);

Remove the primary key from the old props table

 ALTER TABLE PROPS_OLD


DROP CONSTRAINT PK__8787311965940505384;

Add primary key to the new props table

 ALTER TABLE PROPS


ADD CONSTRAINT PK__8787311965940505384 PRIMARY KEY ("ITEMPK", "NAME", "LANGPK");

Drop old props table that is now useless

 DROP TABLE PROPS_OLD;

Check for duplicates in table typesystemprops in order to avoid ORA0001

 SELECT * FROM typesystemprops WHERE ITEMPK IN (SELECT ITEMPK FROM PROPS WHERE
itemtypePK IN (SELECT PK FROM composedtypes WHERE itemJNDIName IN
('de.hybris.platform.persistence.type.ComposedType', 'de.hybris.platform.persistence.type.AtomicType',
'de.hybris.platform.persistence.type.CollectionType', 'de.hybris.platform.persistence.type.MapType',
'de.hybris.platform.persistence.type.AttributeDescriptor',
'de.hybris.platform.persistence.enumeration.EnumerationValue')));

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 8
R18A_Hybris_Migration_Guide

If results are found. Delete them

 Delete from typesystemprops where ITEMPK in (select ITEMPK from PROPS where itemtypePK IN (
select PK from composedtypes where itemJNDIName IN
('de.hybris.platform.persistence.type.ComposedType', 'de.hybris.platform.persistence.type.AtomicType',
'de.hybris.platform.persistence.type.CollectionType', 'de.hybris.platform.persistence.type.MapType',
'de.hybris.platform.persistence.type.AttributeDescriptor',
'de.hybris.platform.persistence.enumeration.EnumerationValue')));

4.4.1.3 INDEX DROP:


Depending on the instance, some indexes will not exist. Run anyways the drop instructions below.
- DROP INDEX uniqueIdx_11018_11018;
- DROP INDEX itempk_props;
- DROP INDEX realnameidx_props;
- DROP INDEX nameidx_props;

4.4.1.4 Duplicate values clean

 Duplicate MEDIAS records


Check if the column “P_CODE” in the table MEDIAS is correct, because it can change between brands.
if “P_CODE” does not exist, use “CODE” instead.

CREATE GLOBAL TEMPORARY TABLE duplicateToKEEP ON COMMIT PRESERVE ROWS AS


SELECT P_CODE, P_CATALOGVERSION, MIN(PK) AS minPK FROM MEDIAS
GROUP BY P_CODE, P_CATALOGVERSION HAVING COUNT(*) > 1;

CREATE GLOBAL TEMPORARY TABLE duplicateToDROP ON COMMIT PRESERVE ROWS AS


SELECT PK AS pkToDrop FROM MEDIAS ME INNER JOIN duplicateToKEEP DK ON ME.P_CODE=DK.P_CODE
AND CONCAT(ME.P_CATALOGVERSION,'magic')=CONCAT(DK.P_CATALOGVERSION,'magic') and
minPK!=PK;

DELETE FROM MEDIAS WHERE PK IN(SELECT pkToDrop FROM duplicateToDROP);

TRUNCATE TABLE duplicateToKEEP;


DROP TABLE duplicateToKEEP;
TRUNCATE TABLE duplicateToDROP;
DROP TABLE duplicateToDROP;
COMMIT;

 Duplicate ORDERS records


CREATE GLOBAL TEMPORARY TABLE duplicateOrdersToKEEP ON COMMIT PRESERVE ROWS AS
SELECT P_MERCHANTREFERENCECODE, P_VERSIONID, P_ORIGINALCARTID, max(CREATEDTS) AS
maxCREATEDTS FROM ORDERS
GROUP BY P_MERCHANTREFERENCECODE, P_VERSIONID, P_ORIGINALCARTID HAVING COUNT(*) > 1;

CREATE GLOBAL TEMPORARY TABLE duplicateOrdersToDROP ON COMMIT PRESERVE ROWS AS

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 9
R18A_Hybris_Migration_Guide

SELECT PK AS pkToDrop FROM ORDERS ME INNER JOIN duplicateOrdersToKEEP DK ON


ME.P_MERCHANTREFERENCECODE=DK.P_MERCHANTREFERENCECODE
AND CONCAT(ME.P_ORIGINALCARTID,'magic')=CONCAT(DK.P_ORIGINALCARTID,'magic') AND
maxCREATEDTS!=CREATEDTS;

DELETE FROM ORDERS WHERE PK IN(SELECT pkToDrop FROM duplicateOrdersToDROP);

TRUNCATE TABLE duplicateOrdersToKEEP;


DROP TABLE duplicateOrdersToKEEP;
TRUNCATE TABLE duplicateOrdersToDROP;
DROP TABLE duplicateOrdersToDROP;

COMMIT;

4.4.1 PRELIMINAR FIXES TO DO IN THE DATABASE:

Once the deployment will be complete go to HYBADM<ENV><INSTANCE>01 node and run the below instructions
as appuser: -
cd /app/hybris/bin/platform
. ./setantenv.sh
ant updatesystem –DtypeSystemOnly Dtenant=$tenant_name =true

If you get error ORA-00955 drop index mentioned in ERROR message

Once the BUILD SUCCESSFUL message will be prompted,


N.B. if you find an error similar to the following one:
ERROR [hybrisHTTP23] [OldPropertyJDBC] found NULL value for (item=8796822011991,name=sqlcolumndes criptions,lang=null,typeCode=7)
- using '' instead
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
at de.hybris.platform.persistence.property.DBPersistenceManager.getCustomColumnDescription(DBPersistenceManager.java:1477)
at de.hybris.platform.persistence.property.DBPersistenceManager.createInfoImpl(DBPersistenceManager.java:1353)
at de.hybris.platform.persistence.property.DBPersistenceManager.createInfo(DBPersistenceManager.java:1157)

You have to execute follow step from SQL Developer to fix:-

1. Open SQL developer


2. Run “select * from TYPESYSTEMPROPS where REALNAME = 'sqlcolumndescriptions';” and export the
result in case you need to reimport them.
3. Run
DELETE FROM TYPESYSTEMPROPS where REALNAME = 'sqlcolumndescriptions';
COMMIT;

4. Run update system with “Update running system”

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 10
R18A_Hybris_Migration_Guide

4.5 Run the procedures .sql to clean the DB

1) Pull from AE_Tools


2) The files are in the folder: AE_Tools\dbClean\R18A
3) Run “index_dropper.sql”, "product_marker.sql" and “promotional_markers_update.sql”,
"Update_customers_email.sql", “place_order_guid_fill.sql” in all instances.

4.6 Start the server

You can start the server by redeploying with the below parameters:
*Please note: all the options that are not specified below must keep their default values.
1. RESTART_SERVER to “START_ONLY_ADMIN”
2. DEPLOY_CODE to “FALSE”
3. DEPLOY_CONFIG to “TRUE”
4. ENABLE_UPDATE_RUNNING_SYSTEM to FALSE

4.7 Lucene search job disable


Manually disable all the "lucenesearch" cronjobs
Before the full update system we have to disable all the cronjobs related to the "lucenesearch" module.
Open the HMC -> system -> cronjobs
Search: CODE – contains – lucene
Disable all the jobs found

Do this for all the brands

4.8 Full system update (90 min)


Run an update using HAC->Platform->update. (do not select Update Running System flag, you already
performed it with step 4.2) Update with the following projects:

a. Clear the hMC configuration from the database


b. Create essential data
c. Localized types
d. Select the following projects:

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 11
R18A_Hybris_Migration_Guide

aii18n
alipaydirect
multicountry
hmcore
hmbackoffice
backoffice
commercesearchbackoffice
hmxmlimpex
hminterfaces
hmwebservices
cockpit
cmscockpit
cscockpit
productcockpit
goeptaskengine
Hmcockpits
hmdashboard
addressdoctor
daum
hmfacades
hmsapoaainterfaces
appcore
 Content Catalog [YES]
 Sync Product [NO]
 Activate Solr Cronjob [NO]
 Import Geo Data [YES]
 Import Color and Size Filter Order [NO]
 Update On Mongo [NO]
appfacades
appcockpits
appaddressdoctor
appbackoffice

Make sure to check the logs for any errors.

4.9 Post update sys procedures -


Perform all the procedures into the AE_Tools\dbClean\R17C\
 Price.sql: procedure to copy an attribute from HMMarket type directly to the price (in order to get rid of the
HMMarket type);
 UPDATE_FIRSTSHIPORDERDATE: procedure to populate the newly created attribute “firstShipOrder” on
the customerModel;
 UPDATE_LASTLOGIN: procedure to populate the attribute “lastLogin” on the CustomerModel (where it’s
not already populated);
 UPDATE_LASTORDERDATE: procedure to set the lastOrderDate on the CustomerModel;
 UPDATE_SWATCHTYPE_DEFAULTVALUE_EU1: procedure to set the defaultValue of swatchType in
product where it’s not already populated.(the procedure will run only for EU1)
 UPDATE_USERS_AFFILIATES: query to set costumer type as "registered" all the old customers on the
site instead of null (N.B. in some cases column P_UID doesn't exist, use instead P_ORIGINALUID)

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 12
R18A_Hybris_Migration_Guide

 StaffCard_set_Expiry_procedure: creates the procedure called in I046 for staff card import
Execute the following index creation to improve task SELECT in order to improve BP search
CREATE INDEX HM01_TASKS_001 ON
TASKS("P_FAILED","P_NODEGROUP","P_RUNNINGONCLUSTERNODE","TYPEPKSTRING","P_CONDITIO
NSDUE");

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 13
R18A_Hybris_Migration_Guide

4.9.1.1 Check unique index on products table


Check index CODEVERSIONIDX_1, if it is NOT UNIQUE:

1- Run select {code},{catalogVersion} from {product} group by {code},{catalogVersion} having count(*) > 1
2- Remove all duplicates
3- Run follow script to create the unique index

DROP INDEX CODEVERSIONIDX_1;


CREATE UNIQUE INDEX CODEVERSIONIDX_1 ON products (p_code, p_catalogVersion);
COMMIT;

4.10 Goep task engine activation


Follow the instruction of the PDF attached below.

Task engine.pdf

4.11 Deploy other modules

ATP module has to be installed as well (GOEP-ATP-Deploy related to specific instance). (5min) -
Apptus module has to be installed as well (GOEP-ApptusGW-Deploy related to specific instance) (5min)
CIS module has to be installed as well (GOEP-CIS-Deploy related to specific instance) (5min)
DPS module has to be installed as well (GOEP-DPS-Deploy related to specific instance) (5min)
Review module has to be installed as well (GOEP-ReviewsGW-Deploy related to specific instance) (5min) Commented [SA1]: How can we know which of them
should be executed or updated on which environment ?
Store Locator module has to be installed as well (GOEP-SIS-Deploy related to specific instance) (5min)

4.12 Run SQL script -

Try to connect to hmc, if you look follow exception in the console log, you must execute follow steps to fix.
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List
at de.hybris.platform.jalo.c2l.Language.getFallbackLanguages(Language.java:142)
at de.hybris.platform.jalo.c2l.GeneratedLanguage.getFallbackLanguages(GeneratedLanguage.java:62)
at de.hybris.platform.util.Utilities.getLocalePath(Utilities.java:1619)
at de.hybris.platform.util.Utilities.getResourceBundle(Utilities.java:1785)

To fix the issue:


Try to execute the impex “languages.impex” from hac
1- If it is imported successfully  no action required.
2- Otherwise if the follow exception is shown:

Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.List


at de.hybris.platform.jalo.c2l.Language.getFallbackLanguages(Language.java:142)
at de.hybris.platform.jalo.c2l.GeneratedLanguage.getFallbackLanguages(GeneratedLanguage.java:62)

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 14
R18A_Hybris_Migration_Guide

at de.hybris.platform.util.Utilities.getLocalePath(Utilities.java:1619)
at de.hybris.platform.util.Utilities.getResourceBundle(Utilities.java:1785)

You must remove the name column and reimport the impex from hac, and after import the complete
languages.impex file to restore translated names.

4.13 Remove cache


1.Go to HAC->Monitoring->Cache and press clear cache

4.14 Check synchronization job configuration


Check if all synchronization jobs are configurated as “MultiCountryCatalogVersionSyncJob” and “Create new
elements” and “Remove missing elements” flags set to true.

In case of some synchronization jobs have different configuration, change it as described above.

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 15
R18A_Hybris_Migration_Guide

N.B. Check that SolrHeroProductDefinition ISN’T on root types list on


synchronization cronjob

4.15 Change category type


With the hotfix 18A MR01 we must change the “category” type from the HMC

In HMC open System->types->search “category” ->properties tab

Select attribute categoryHeroDefinitions and check Don’t copy flag in advanced properties.

4.16 Run Alt text job for images


Also note that a new cronjob ‘appImagesAltTextGeneratorJob’ needs to be run for all the brands post
deployment.

4.17 Run Apptus export


1. Go to HMC->System->Cronjobs and search jobs start with cmp_fullProductAndStockFeedJob
a. This job takes a lot of time
2. Run every cronjob and make sure that it succeeds.
3. Make sure to check the logs for errors.
a. If you find in the logs that the job is configured towards the wrong market, change it here:

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 16
R18A_Hybris_Migration_Guide

4.18 Server deploy (Phase 2)


1. Find the correct instance on Jenkins.
2. Press the menu option “Build with parameters”.
3. Chose the ENV/NAME, DeployBuild and instance.
4. Set DEPLOY_CODE to ‘false’.
5. Set RESTART_SERVER to “START”
6. Start the deploy

4.19 Check availability


When the server is started check the availability. Perform smoke tests.
o Verify cluster is properly configured
o For each node verify that are nodes are visible
o Try basic functionality such as checkout.
o Try new functionality.
o Verify integration with external system

5 Notes
5.1 Dependency of the steps
5.1.1 SQL Developer connection
Connect remotely to the windows desktop using the suitable jumphost IP.
1. Open SQLDeveloper found on path D:\Installers\sqldeveloper.
2. If you need username and password for SQL, follow these steps (Note that Sudo rights are needed for
these steps):
a. Use putty to connect to HYBADM<ENV><GEO>01.
b. Navigate to /app/hybris/config/ and open local.properties.. Commented [RS2]: Sudo rights needed to change to
3. Enter the connection info to the database. It should look like appuser

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 17
R18A_Hybris_Migration_Guide

Copyright © 2016 Accenture. All Rights Reserved. Accenture Confidential and Proprietary. Disclosure subject to the consent of Accenture 18

Das könnte Ihnen auch gefallen