Run Pipeline Batch

Now you can run the pipeline batch MongoDB Contacts to xConnect Migration. The new contact identifier Loyalty.Program will be created on xConnect contacts if the required data is available in MongoDB.

After you run the pipeline batch, there are multiple ways you can check to confirm the contact identifier was properly created.

xConnect Collection Database

You can check the xConnect collection database for records that represent the new facet.

  1. Connect to one of the collection database shards.
  2. Use the following query:
SELECT ContactId, Source, CONVERT(VARCHAR(MAX), Identifier) AS Identifier
  FROM xdb_collection.ContactIdentifiers
  WHERE Source = 'Loyalty.Program'

You should see a row for each MongoDB contact that has loyalty program data associated with it.

ContactId Source Identifier
########-####-####-####-############ Loyalty.Program ######

xConnect Client

You can write an application that uses the xConnect client API to find a contact using its loyalty program membership id.

var model = new XdbRuntimeModel(CustomMigrationModel.Model);
Uri uri = ... //your xConnect server location goes here
var config = new XConnectClientConfiguration(model, uri);
await config.InitializeAsync();
using (var client = new XConnectClient(config))
{
    var identifierSource = "Loyalty.Program";
    var membershipId = "######"; //the membership id for the contact you want to get goes here
    var identifier = new IdentifiedContactReference(identifierSource, membershipId);
    var expandOptions = new ExpandOptions(LoyaltyProgramInfo.DefaultFacetKey);
    var contact = await client.GetContactAsync(identifier, expandOptions);
}