Category: Data-Migration

Data Migration is a topic the MagnusMinds engineering team writes about from project work: how it is set up, where it breaks, and what we changed in production. This category page lists all 2 articles filed under Data Migration.

Start with “Migrating Over One Million Attachment Records Reliably” or “Migrating 100+ Business Central Tables into Azure SQL with Azure Data Factory”. Open a post for the full write-up, or follow another tag or category on the card to a related topic.

Migrating Over One Million Attachment Records Reliably
Oct 28, 2026 6 min read

Introduction On paper, moving data between two systems looks simple. In practice, it rarely is. Halfway through, files go missing, mappings stop lining up, long jobs time out, and duplicate records slip in. When the work is finally done, someone still has to prove that more than a million records arrived where they belong. Our team at MagnusMinds recently faced this exact challenge. The goal was to migrate a large collection of document attachments from an older source environment into a modern business platform. With over one million files, complex connections between records, and no room for errors, a simple file transfer was out of the question. Here is how we broke down the problem, built a reliable setup with Azure Data Factory and Python, and made sure the migration could recover smoothly from any issue. What Is Large-Scale Attachment Migration? Large-scale attachment migration is the controlled transfer of files along with their details and business connections. The goal is to make sure every file lands in the target system linked to the right business record, so it can be easily found and opened. Three key things separate it from a standard file copy: Context travels with the file: Every file belongs to a business record, such as a material, product, or vendor. That connection must stay in place. Details matter as much as the file itself: File names, types, IDs, and dates decide whether the target platform can actually read and use the document. Accuracy must be easy to prove: When handling millions of items, you need clear proof of what succeeded, what failed, and that nothing was lost or duplicated. The Challenge Several technical challenges came together to make this migration difficult: Huge volume: Moving over one million attachment records ruled out manual or half-manual methods from day one. Complex mapping: Documents had to be matched to specific material numbers using CSV files that listed document IDs, file names, file extensions, and material numbers. One material, multiple documents: A single material could have several files attached to it. The system had to support valid multi-file connections without creating unwanted duplicate records. Files on an SFTP server: The actual documents lived on an external SFTP server. Each file had to be found and retrieved as the pipeline ran. Pipeline time limits: Cloud systems have strict run-time limits. Pushing too much data at once causes jobs to time out or stop unexpectedly. Recovering failed batches: If an error occurred halfway through, we needed a way to re-run only the failed records without starting the whole migration over. Platform synchronization: After updating the database, a sync API had to be called so the new files appeared right away in the platform user interface. How Azure Data Factory and Python Solve It We split the work between two core tools with clear roles: Azure Data Factory (ADF) acts as the manager, deciding what runs, in what order, and what happens if something fails. A Python-based Azure Function acts as the worker, reading the mapping files, finding the documents, and preparing database updates. The pipeline runs through eight clear steps: Find mapping files: A GetMetadata activity checks a folder in Azure Blob Storage and makes a list of all CSV mapping files waiting to be processed. Process files one at a time: A ForEach activity picks up each mapping file in order. Processing one file at a time keeps things stable and makes errors easy to pinpoint. Run the Azure Function: For each file, ADF calls the Python Azure Function with a batch size of 100 records. The Function searches the SFTP server, matches files against the CSV rows, and returns three sets of database instructions: one for attachment records, one for the sync API, and one for file names. Update database records: ADF runs the attachment database instructions returned by the Function directly against the target database. Sync only when needed: An IfCondition checks whether there are platform updates to apply. If yes, it calls the platform sync API. If not, the step is skipped cleanly. Update file names: A final database step updates document names and paths in the platform tables. Keep going after a failure: Every step has a fallback path. If an individual file hits an issue, the pipeline logs the error and moves straight to the next file instead of stopping the entire run. Retry temporary errors automatically: If the Azure Function call fails due to a temporary network issue, it retries up to two times automatically, waiting 60 seconds between attempts. Key Features Automatic file discovery: picks up incoming mapping files on its own without needing a manual list. Step-by-step batch execution: handles one CSV at a time with 100 records per Function call to keep runs smooth and safe. Centralized business logic: the Azure Function builds ready-to-run database scripts, keeping all rules in code rather than cluttered pipeline settings. Three-stage database updates: handles attachment records, sync payloads, and file names in separate, safe steps. Smart API calls: triggers the sync API only when there are real changes to send, avoiding wasted calls. Non-stop error handling: built-in fallbacks allow the pipeline to keep processing remaining files even if one file fails. Advantages No manual tracking: Mapping files are found and processed automatically from start to finish. Predictable run times: Batches of 100 records keep memory usage low and prevent jobs from timing out. Runs without constant supervision: Built-in fallbacks mean the pipeline can process thousands of files without needing someone to watch it the whole time. Targeted re-runs: Failed files can be reprocessed on their own without repeating work that already finished successfully. Clear visibility: ADF provides a clear record of every single file and step, making it easy to see what succeeded and what failed. Limitations to Keep in Mind Mapping file quality is very important: The pipeline depends completely on accurate CSV mapping files. Any missing or wrong information in those files will cause errors. External SFTP dependency: If the SFTP server slows down or drops its connection, file lookups will fail and those batches will be skipped. Function updates require a quick code release: Because the business rules live inside the Python Azure Function, adding new file types or conditions requires updating the code. One-by-one processing trades speed for safety: Processing files one at a time is very stable and easy to fix, but it takes longer than running everything at once. Business Impact Migrating more than one million document attachments requires both accuracy and dependability. A single failure should never put days of work at risk. This solution gave the team a reliable, automated way to move records. It transferred data in controlled batches, caught and isolated errors without losing completed work, and kept the business platform updated in real time. The migration finished without manual file hunting or guessing which records had made it across. Conclusion Large-scale data migrations are rarely just about copying files. True reliability comes from designing workflows that respect system limits, protect connections between business records, and recover smoothly when something goes wrong. By combining Azure Data Factory for pipeline management with Python Azure Functions for flexible processing, teams can turn massive, stressful migrations into predictable, everyday operations.

Migrating 100+ Business Central Tables into Azure SQL with Azure Data Factory
Jul 15, 2026 2 min read

Overview Microsoft Dynamics 365 Business Central is a powerful ERP solution for managing finance, sales, inventory, purchasing, and operations. However, organizations often require this operational data in a centralized analytics platform to support reporting, business intelligence, and data-driven decision-making. At MagnusMinds, we partnered with a client looking to migrate over 100 Business Central tables into Azure SQL. The goal was not just to move data, but to build a scalable and automated integration framework that could support future reporting and ongoing data synchronization. The Challenge Migrating large volumes of ERP data comes with several challenges: Data spread across more than 100 Business Central entities. Manual extraction processes that were time-consuming and difficult to maintain. Different API endpoints requiring varying request structures. Evolving source schemas that increased maintenance effort. Need to support both historical migration and incremental updates. Requirement for reliable monitoring and error handling. The client needed a solution that was scalable, automated, and easy to maintain. Our Solution Using Azure Data Factory, we built a metadata-driven integration framework that automated data extraction from Business Central through OData APIs and loaded it into Azure SQL. The solution was designed to: Automate migration of 100+ Business Central tables. Support both Full Load and Incremental Load processing. Standardize and validate data before loading into Azure SQL. Simplify onboarding of new Business Central entities through reusable configurations. Provide centralized logging and monitoring for improved operational visibility. This approach reduced development effort while creating a flexible platform that can easily scale as business requirements evolve. Business Impact The solution delivered immediate value by: Successfully migrating over 100 Business Central tables into Azure SQL. Eliminating manual exports and repetitive integration processes. Improving data consistency and reliability for reporting. Enabling faster access to operational data for analytics. Establishing a scalable data integration framework for future growth. Providing a trusted data foundation for Power BI and enterprise reporting. Final Thoughts Migrating ERP data is more than a one-time data movement exercise it's about creating a reliable and scalable foundation for business intelligence. By leveraging Azure Data Factory and Azure SQL, organizations can automate Business Central data integration, reduce manual effort, and ensure business users always have access to accurate and up-to-date information for better decision-making. At MagnusMinds, we help organizations modernize their data platforms with scalable Azure solutions that turn operational data into actionable business insights.