This guide provides a comprehensive approach to migrating large volumes of client data to DAL using our bulk import APIs. Whether you’re migrating from a legacy system or consolidating data from multiple sources, this guide will help you implement a robust migration strategy.

Overview

DAL’s bulk import API allows you to efficiently migrate large datasets while maintaining data integrity and system performance. This guide covers:
  • Batch Processing: How to handle importing large datasets efficiently.
  • Data Validation: Ensuring data quality before import.
  • Error Handling: Robust retry mechanisms and failure recovery.
  • Performance Optimization: Best practices for optimal throughput when integrating with Dal.

Prerequisites

Before starting your migration, ensure you have:
  • API Credentials: Contact your DAL administrator for API key and tenant information.
  • Data Access: Access to your source data (CSV, database, etc.).
  • Network Connectivity: Stable connection to DAL’s API endpoints.

What We Expect From You

The migration process involves making HTTP calls to DAL’s bulk client endpoint. Your client data should be prepared and sent in batches to this endpoint. Once received, DAL’s backend system will process these batches, validate the data, and reflect the imported clients in the web portal for your compliance team’s review and management. To facilitate this, your development team should implement a dedicated service layer or a migration script that extracts data from your existing database and transforms it into the required format before sending it to DAL via HTTP requests.

Migration Examples

Python Implementation

Required Python Packages

Configuration

API Endpoints
Authentication Headers
Batch Configuration
Duplicate Modes
Choose how to handle existing clients during migration:
  • Skip: Skip existing clients (recommended for migrations).
  • Update: Update existing clients with new data.

Data Mapping

Client Fields

Fields:
  • nameEn - Name in English (string)
  • nameAr - Name in Arabic (string)
  • type - Entity type (Individual/Organization)
  • email - Email address
  • accountOpenDate - Account opening date (ISO format)
  • dobGregorian - Date of birth (ISO format)
  • dateOfIncorporationGregorian - Incorporation date (ISO format)
  • nationalityCode - ISO 3166-1 alpha-2 country code
  • status - Client status
  • identities - Array of identities with a minimum size of 1
Note: For the complete request payload structure and field specifications, refer to the Bulk Insertion API Endpoint documentation.

Nationality Mapping

Map your nationality values to ISO 3166-1 alpha-2 codes:

Data Validation

Date Format Conversion

Convert dates to ISO format (YYYY-MM-DD):

Client Validation

Batch Processing

Reading Data in Batches

Data Mapping Function

Error Handling and Retries

Robust Batch Sending

Complete Migration Script (Python Example, Typescript Example Is Provided In The Next Section)

Best Practices When Implementing Your Own Migrator Service/Script

1. Error Handling

  • Implement comprehensive retry logic
  • Log all failures for debugging
  • Validate data before sending
  • Handle network timeouts gracefully
  • Keep track of batches to retry failed ones later

2. Performance Monitoring

  • Track processing time per batch
  • Log progress regularly
  • Set up alerts/logs for failures

3. Data Quality

  • Validate required fields before sending
  • Clean and normalize data
  • Handle missing or invalid dates
  • Map nationalities correctly

Troubleshooting

Common Issues

  1. Authentication Errors: Verify API key and tenant name
  2. Validation Failures: Check required fields and data formats
  3. Timeout Errors: Reduce batch size or increase timeout
  4. Memory Issues: Process data in smaller batches

Debug Mode

Enable detailed logging for troubleshooting:

Post-Migration

Case Generation

After completing client migration, log into the portal to review historical data case matching results.

Verification

Verify your migration by:
  1. Checking client counts in DAL dashboard
  2. Validating sample records
  3. Testing case generation
  4. Reviewing audit logs

Support

For migration assistance:
  1. Review this guide thoroughly
  2. Test with small datasets first and keep track of your batch successes and failures
  3. Contact your DAL administrator or development team for support via the dedicated Slack channel

API Reference

Bulk Import Endpoint

POST /services/crm/clients/bulk Import multiple clients in a single request. Headers:
  • x-api-key: Your API key
  • x-tenant: Your tenant name
  • Content-Type: application/json
Request Body:
Response:

TypeScript Implementation

For Node.js environments, here’s a TypeScript implementation:

Required Packages

Migration Script (TypeScript Example)

Key Differences from Python

  • Type Safety: Full TypeScript types for better development experience.
  • Async/Await: Native promise handling.
  • Streaming: Efficient data processing with streams.
  • Error Handling: Structured error handling with try/catch.

Requesting Help In Implementing The Scripts

You can request help by contacting your DAL administrator or support team for migration assistance, please include details about your tech stack, areas of difficulty, and specific ways our development team can help.