private boolean updateExistingDataType(DataType existingDataType, DataType dataType,
			SourceArchive sourceArchive) throws DataTypeDependencyException {

		try {
			if (existingDataType instanceof StructureDB existingStruct) {
				if (!(dataType instanceof StructureInternal replacementStruct)) {
					return false;
				}
				existingStruct.doReplaceWith(replacementStruct, true);
			}
			else if (existingDataType instanceof UnionDB existingUnion) {
				if (!(dataType instanceof UnionInternal replacementUnion)) {
					return false;
				}
				existingUnion.doReplaceWith(replacementUnion, true);
			}
			else if (existingDataType instanceof FunctionDefinitionDB existingFuncDef) {
				if (!(dataType instanceof FunctionDefinition replacementFuncDef)) {
					return false;
				}
				existingFuncDef.doReplaceWith(replacementFuncDef, true);
			}
			else if (existingDataType instanceof EnumDB) {
				if (!(dataType instanceof Enum)) {
					return false;
				}
				// DT: implement doReplaceWith
				existingDataType.replaceWith(dataType);
			}
			else if (existingDataType instanceof TypedefDB) {
				if (!(dataType instanceof TypeDef)) {
					return false;
				}
				// DT: implement doReplaceWith
				existingDataType.replaceWith(dataType);
			}
			else {
				return false;
			}

			if (sourceArchive != null) {
				existingDataType.setSourceArchive(sourceArchive);
				((DataTypeDB) existingDataType).setUniversalID(dataType.getUniversalID());
				long lastChangeTime = dataType.getLastChangeTime();
				existingDataType.setLastChangeTime(lastChangeTime);
				existingDataType.setLastChangeTimeInSourceArchive(lastChangeTime);
			}
			return true;
		}
		catch (IOException e) {
			dbError(e);
		}
		return false;
	}
When performing a replacement during conflict resolution, this method handles
an update approach for structure and union replacement.

@param existingDataType existing datatype
@param dataType         new datatype
@param sourceArchive source archive associated with new type (may be null).
If not null the existingDataType will be updated with source info.
@return true if replacement approach was successful, else false
@throws DataTypeDependencyException if datatype contains dependency issues
                                    during resolve process
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/DataTypeManagerDB.java