code: private void transferSettingValues(CmsEntity source, CmsEntity target) {
  
          for (CmsEntityAttribute attr : source.getAttributes()) {
              if (isSettingsAttribute(attr.getAttributeName())) {
                  if (attr.isSimpleValue()) {
                      target.addAttributeValue(attr.getAttributeName(), attr.getSimpleValue());
                  } else {
                      CmsEntity nestedSource = attr.getComplexValue();
  
                      CmsEntity nested = new CmsEntity(nestedSource.getId(), nestedSource.getTypeName());
                      for (CmsEntityAttribute nestedAttr : nestedSource.getAttributes()) {
                          nested.addAttributeValue(nestedAttr.getAttributeName(), nestedAttr.getSimpleValue());
                      }
                      target.addAttributeValue(attr.getAttributeName(), nested);
                  }
              }
          }
      }
docs: Transfers settings attribute values from one entity to another.<p>
  
  @param source the source entity
  @param target the target entity