Skip to content

Commit 55f156b

Browse files
initial commit Commerce DB Sync
1 parent 7c9c3c4 commit 55f156b

File tree

216 files changed

+16613
-238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+16613
-238
lines changed

DISCLAIMER.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
These Project development objects are not managed or delivered or intended for future inclusion as a standard component of the SAP Software. Therefore, at Project closure, these Project development objects will not include any further support services, defect resolution, maintenance, or upgrades or in any way be within scope of SAP support obligations for licensed SAP Software. Licensee is solely responsible for supporting such objects. SAP does not assure the compatibility of such objects with future releases of SAP Software or other SAP solutions.

LICENSE

Lines changed: 202 additions & 201 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 87 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,87 @@
1-
# SAP Repository Template
2-
3-
Default templates for SAP open source repositories, including LICENSE, .reuse/dep5, Code of Conduct, etc... All repositories on github.com/SAP will be created based on this template.
4-
5-
## To-Do
6-
7-
In case you are the maintainer of a new SAP open source project, these are the steps to do with the template files:
8-
9-
- Check if the default license (Apache 2.0) also applies to your project. A license change should only be required in exceptional cases. If this is the case, please change the [license file](LICENSE).
10-
- Enter the correct metadata for the REUSE tool. See our [wiki page](https://wiki.wdf.sap.corp/wiki/display/ospodocs/Using+the+Reuse+Tool+of+FSFE+for+Copyright+and+License+Information) for details how to do it. You can find an initial .reuse/dep5 file to build on. Please replace the parts inside the single angle quotation marks < > by the specific information for your repository and be sure to run the REUSE tool to validate that the metadata is correct.
11-
- Adjust the contribution guidelines (e.g. add coding style guidelines, pull request checklists, different license if needed etc.)
12-
- Add information about your project to this README (name, description, requirements etc). Especially take care for the <your-project> placeholders - those ones need to be replaced with your project name. See the sections below the horizontal line and [our guidelines on our wiki page](https://wiki.wdf.sap.corp/wiki/display/ospodocs/Guidelines+for+README.md+file) what is required and recommended.
13-
- Remove all content in this README above and including the horizontal line ;)
14-
15-
***
16-
17-
# Our new open source project
18-
19-
## About this project
20-
21-
*Insert a short description of your project here...*
22-
23-
## Requirements and Setup
24-
25-
*Insert a short description what is required to get your project running...*
26-
27-
## Support, Feedback, Contributing
28-
29-
This project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/SAP/<your-project>/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md).
30-
31-
## Code of Conduct
32-
33-
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its [Code of Conduct](CODE_OF_CONDUCT.md) at all times.
34-
35-
## Licensing
36-
37-
Copyright (20xx-)20xx SAP SE or an SAP affiliate company and <your-project> contributors. Please see our [LICENSE](LICENSE) for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/SAP/<your-project>).
1+
# SAP Commerce DB Sync
2+
3+
[![REUSE status](https://api.reuse.software/badge/github.com/SAP-samples/commerce-migration-toolkit)](https://api.reuse.software/info/github.com/SAP-samples/commerce-migration-toolkit)
4+
5+
SAP Commerce DB Sync performs table-to-table replication in single-directionally manner between two SAP Commerce instances (onPrem to Cloud) or between SAP Commerce and an external database.
6+
7+
SAP Commerce DB Sync is implemented as SAP Commerce extensions and it does not require any third-party ETL.
8+
9+
There are two main use cases:
10+
* __Replicate data across an external database__: you can push data regularly in batch mode through a Commerce Cloud cronjob and synchronize to an external database. A typical use case is for analytics and reporting purpose when you need direct JDBC access to the database to run analytic jobs.
11+
* __Data migration__: paired with the self-service media process described on [this CXWorks article](https://www.sap.com/cxworks/article/2589632453/migrate_to_sap_commerce_cloud_migrate_media_with_azcopy), it allows to self-service a one-shot data migration from the on-premise SAP Commerce environment to a SAP Commerce Cloud subscription.
12+
13+
# Getting started
14+
15+
* [User Guide for Data Replication](docs/user/USER-GUIDE-DATA-REPLICATION.md) Go through the details about Data replication between SAP Commerce Cloud and an external database.
16+
* [User Guide for Data Migration](docs/user/USER-GUIDE-DATA-MIGRATION.md) When ready to start the migration activities, follow the instructions in the User Guide to trigger the data migration.
17+
* [Configuration Guide](docs/configuration/CONFIGURATION-GUIDE.md) The extensions ship with a default configuration that may need to be adjusted depending on the desired behaviour. This guide explains how different features and behaviours can be configured.
18+
* [Security Guide](docs/security/SECURITY-GUIDE.md) A data migration typically features sensitive data and uses delicate system access. Make sure you have read the Security Guide before you proceed with any migration activities and thereby acknowledge the security recommendations stated in the guide.
19+
* [Performance Guide](docs/performance/PERFORMANCE-GUIDE.md) Performance is crucial for any data migration, not only for large databases but also generally to reduce the time of the cut-over window. The performance guide explains the basic concept of performance tuning and also provides benchmarks that will give you an impression of how to estimate the cutover time window.
20+
* [Developer Guide](docs/developer/DEVELOPER-GUIDE.md) If you want to contribute please read this guide.
21+
* [Troubleshooting Guide](docs/troubleshooting/TROUBLESHOOTING-GUIDE.md) A collection of common problems and how to tackle them.
22+
23+
# Features Overview
24+
25+
* Database Connectivity
26+
* Multipe supported databases: Oracle, MySQL, HANA, MSSQL
27+
* UI based connection validation
28+
* Schema Differences
29+
* UI based schema differences detector
30+
* Automated target schema adaption
31+
* Table creation / removal
32+
* Column creation / removal
33+
* Configurable behaviour
34+
* Data Copy
35+
* UI based copy trigger
36+
* Configurable target table truncation
37+
* Configurable index disabling
38+
* Read/write batching with configurable sizes
39+
* Copy parallelization
40+
* Cluster awareness
41+
* Column exclusions
42+
* Table exclusions/inclusions
43+
* Incremental mode (delta)
44+
* Custom tables
45+
* Staged approach using table prefix
46+
* Reporting / Audit
47+
* Automated reporting for schema changes
48+
* Automated reporting for copy processes
49+
* Stored on blob storage
50+
* Logging of all actions triggered from the UI
51+
52+
# Compatibility
53+
54+
* SAP Commerce (>=1811)
55+
* Tested with source databases:
56+
* Azure SQL
57+
* MySQL (5.7)
58+
* Oracle (XE 11g)
59+
* HANA (express 2.0) and HANA Cloud
60+
* Tested with target databases:
61+
* Azure SQL
62+
* Oracle (XE 11g)
63+
* HANA (express 2.0) and HANA Cloud
64+
65+
# Performance
66+
67+
Commerce DB Sync has been built to offer reasonable performance with large amount of data using the following design:
68+
* Table to table replication using JDBC (low level)
69+
* Selection of tables so we do not need a full synchronization in particular for large technical table (task logs, audit logs...)​
70+
* Multi-threaded and can manage multiple tables at the same time ​
71+
* Using UPSERT (INSERT/UPDATE)
72+
* Use read replica Commerce database as a source database
73+
74+
# Demo Video
75+
Here is a video that presents how to use SAP Commerce DB sync (formerly known as CMT) for data migration from onPrem to Cloud:
76+
https://sapvideoa35699dc5.hana.ondemand.com/?entry_id=1_gxduwrl3
77+
78+
# How to Obtain Support
79+
80+
This repository is provided "as-is"; no support is available.
81+
82+
Find more information about SAP Commerce Cloud Setup on our [help site](https://help.sap.com/viewer/product/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/LATEST/en-US).
83+
84+
With regards Commerce DB Sync, access to the database for customers is and will not be possible in the future and SAP does not provide any additional support on Commerce DB Sync in particular. Support can be bought as paid engagement from SAP Consulting only.
85+
86+
# License
87+
Copyright (c) 2022 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the [LICENSE file](LICENSE).

commercedbsync/.classpath

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
4+
<classpathentry kind="lib" path="web/webroot/WEB-INF/lib/displaytag-1.2.jar"/>
5+
<classpathentry kind="lib" path="web/webroot/WEB-INF/lib/jstl-impl-1.2.jar"/>
6+
<classpathentry exported="true" kind="lib" path="resources"/>
7+
<classpathentry kind="src" output="eclipsebin/classes" path="src"/>
8+
<classpathentry kind="src" output="eclipsebin/web/classes" path="web/src"/>
9+
<classpathentry kind="src" output="eclipsebin/classes" path="testsrc"/>
10+
<classpathentry kind="src" output="eclipsebin/classes" path="gensrc"/>
11+
<classpathentry kind="src" path="/platform"/>
12+
<classpathentry kind="lib" path="/platform/tomcat/lib/tomcat-dbcp.jar" sourcepath="/tmp/.org.sf.feeling.decompiler1586659330919/source/tomcat-dbcp-8.5.32-sources.jar"/>
13+
<classpathentry combineaccessrules="false" kind="src" path="/commercedbsynctypesystem"/>
14+
<classpathentry kind="output" path="eclipsebin/notused"/>
15+
</classpath>

commercedbsync/.springBeans

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beansProjectDescription>
3+
<version>1</version>
4+
<pluginVersion><![CDATA[2.2.4.RELEASE]]></pluginVersion>
5+
<configSuffixes>
6+
<configSuffix><![CDATA[xml]]></configSuffix>
7+
</configSuffixes>
8+
<enableImports><![CDATA[true]]></enableImports>
9+
<configs>
10+
<config>resources/commercedbsync-spring.xml</config>
11+
<config>web/webroot/WEB-INF/commercedbsync-web-spring.xml</config>
12+
</configs>
13+
<configSets>
14+
</configSets>
15+
</beansProjectDescription>

commercedbsync/buildcallbacks.xml

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<!--
3+
~ Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
4+
~ License: Apache-2.0
5+
~
6+
-->
7+
8+
<!--
9+
All hybris buildcallbacks.xml macrodefinitions:
10+
11+
Build/Documentation
12+
13+
before/after ant macro "clean"
14+
<macrodef name="commercedbsync_before_clean"/>
15+
<macrodef name="commercedbsync_after_clean"/>
16+
17+
before/after ant macro "build"
18+
<macrodef name="commercedbsync_before_build"/>
19+
<macrodef name="commercedbsync_after_build"/>
20+
21+
before/after ant macro "compile_core" - the core module of the extension
22+
<macrodef name="commercedbsync_before_compile_core">
23+
<macrodef name="commercedbsync_after_compile_core">
24+
25+
before/after ant macro "compile_web" - the web module of the extension
26+
<macrodef name="commercedbsync_before_compile_web" />
27+
<macrodef name="commercedbsync_after_compile_web" />
28+
29+
before/after ant macro "compile_hmc" - the hmc module of the extension
30+
<macrodef name="commercedbsync_before_compile_hmc" />
31+
<macrodef name="commercedbsync_after_compile_hmc" />
32+
33+
Preparing extension
34+
35+
will be called in the beginning of the ant call and only once (also when using multiple
36+
ant targets e.g. ant build yunittest)
37+
<macrodef name="commercedbsync_only_once_prepare"/>
38+
39+
Creating ear module/production
40+
41+
before/after ant macro "ear"
42+
<macrodef name="commercedbsync_before_ear"/>
43+
<macrodef name="commercedbsync_after_ear"/>
44+
45+
before/after ant macro "production" - for hybris server only
46+
<macrodef name="commercedbsync_before_production" />
47+
<macrodef name="commercedbsync_after_production" />
48+
49+
JUnit Test
50+
51+
before/after ant macro "yunitinit"
52+
<macrodef name="commercedbsync_before_yunitinit" />
53+
<macrodef name="commercedbsync_after_yunitinit" />
54+
55+
before/after ant macro "yunit"
56+
<macrodef name="commercedbsync_before_yunit" />
57+
<macrodef name="commercedbsync_after_yunit" />
58+
59+
Distribution package
60+
61+
before/after ant macro "dist" - internal target; only for use when platform is available in source code
62+
<macrodef name="commercedbsync_after_dist"/>
63+
<macrodef name="commercedbsync_before_dist"/>
64+
65+
before/after ant macro "dist_copy" - internal target; only for use when platform is available in source code
66+
<macrodef name="commercedbsync_before_dist_copy"/>
67+
<macrodef name="commercedbsync_after_dist_copy"/>
68+
69+
With these filters you can override the default extension filters defined in platform/resources/ant/dist/filtersets.xml
70+
<patternset id="extension.commercedbsync.binary.filter">
71+
<patternset refid="extension.filter" />
72+
<exclude name="**/*-source.jar" />
73+
</patternset>
74+
<patternset id="extension.commercedbsync.source.filter">
75+
<exclude name="**/bin/**" />
76+
</patternset>
77+
With this filter you can decide what should be excluded from development zip.
78+
<patternset id="extension.commercedbsync.devzip.filter">
79+
Include all files from extension.source.filter.
80+
<patternset refid="extension.source.filter" />
81+
Exclude unwanted files.
82+
<exclude name="lib/exclude-me.jar" />
83+
</patternset>
84+
85+
--><project name="commercedbsync_buildcallbacks">
86+
87+
<macrodef name="commercedbsync_after_build">
88+
89+
<sequential>
90+
91+
<patchAzureCloudUtils/>
92+
93+
</sequential>
94+
95+
</macrodef>
96+
97+
<macrodef name="commercedbsync_before_ear">
98+
99+
<sequential>
100+
101+
<patchAzureCloudUtils/>
102+
103+
</sequential>
104+
105+
</macrodef>
106+
107+
<macrodef name="commercedbsync_before_production">
108+
109+
<sequential>
110+
111+
<patchAzureCloudUtils/>
112+
113+
</sequential>
114+
115+
</macrodef>
116+
117+
<macrodef name="commercedbsync_before_dist">
118+
119+
<sequential>
120+
121+
<patchAzureCloudUtils/>
122+
123+
</sequential>
124+
125+
</macrodef>
126+
127+
<macrodef name="patchAzureCloudUtils">
128+
129+
<sequential>
130+
131+
<if>
132+
133+
<available file="${ext.azurecloud.path}/bin/azurecloudserver.jar"/>
134+
135+
<then>
136+
137+
<echo>PATCHING azurecloudserver.jar to enable configurable fake tenants in AzureCloudUtils</echo>
138+
139+
<jar destfile="${ext.azurecloud.path}/bin/azurecloudserver.jar" update="true">
140+
141+
<fileset dir="${ext.commercedbsync.path}/classes" includes="**/AzureCloudUtils.class"/>
142+
143+
</jar>
144+
145+
</then>
146+
147+
<else>
148+
149+
<echo>${ext.azurecloud.path}/bin/azurecloudserver.jar doesn't exist. Cannot patch AzureCloudUtils to
150+
enable fake tenants!
151+
</echo>
152+
153+
</else>
154+
155+
</if>
156+
157+
</sequential>
158+
159+
</macrodef>
160+
161+
</project>

commercedbsync/extensioninfo.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
3+
<!--
4+
~ Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
5+
~ License: Apache-2.0
6+
~
7+
--><extensioninfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="extensioninfo.xsd">
8+
9+
<extension abstractclassprefix="Generated" classprefix="Commercedbsync" managername="CommercedbsyncManager" managersuperclass="de.hybris.platform.jalo.extension.Extension" name="commercedbsync" usemaven="true">
10+
11+
<coremodule generated="true" manager="de.hybris.platform.jalo.extension.GenericManager" packageroot="com.sap.cx.boosters.commercedbsync"/>
12+
13+
14+
</extension>
15+
16+
</extensioninfo>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!--
2+
~ Copyright: 2022 SAP SE or an SAP affiliate company and commerce-db-synccontributors.
3+
~ License: Apache-2.0
4+
~
5+
-->
6+
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
7+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
8+
<modelVersion>4.0.0</modelVersion>
9+
<groupId>de.hybris.platform</groupId>
10+
<artifactId>commercedbsync</artifactId>
11+
<version>6.7.0.0-RC19</version>
12+
13+
<packaging>jar</packaging>
14+
15+
<dependencies>
16+
<dependency>
17+
<groupId>com.google.code.gson</groupId>
18+
<artifactId>gson</artifactId>
19+
<version>2.8.6</version>
20+
</dependency>
21+
<dependency>
22+
<groupId>com.google.guava</groupId>
23+
<artifactId>guava</artifactId>
24+
<version>28.0-jre</version>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.apache.commons</groupId>
28+
<artifactId>commons-dbcp2</artifactId>
29+
<version>2.7.0</version>
30+
</dependency>
31+
<dependency>
32+
<groupId>com.microsoft.azure</groupId>
33+
<artifactId>azure-storage</artifactId>
34+
<version>8.1.0</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>com.zaxxer</groupId>
38+
<artifactId>HikariCP</artifactId>
39+
<version>3.4.5</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>com.github.freva</groupId>
43+
<artifactId>ascii-table</artifactId>
44+
<version>1.1.0</version>
45+
</dependency>
46+
<dependency>
47+
<groupId>com.fasterxml.jackson.datatype</groupId>
48+
<artifactId>jackson-datatype-jsr310</artifactId>
49+
<version>2.13.3</version>
50+
</dependency>
51+
</dependencies>
52+
</project>

0 commit comments

Comments
 (0)