Strategies, Pitfalls, and Two Smart Concepts
Data migrations are often a tricky subject – and not because of schema changes, but because of moving customer data that’s sometimes decades old and comes from a mix of legacy systems. At the Laravel Meetup, PHP developer Phillip shared his experience from numerous projects – and demonstrated how to handle such migrations in a technically sound and sustainable way using Laravel.
You’ll find the full recording below – here’s a quick overview of what to expect:
First, Phillip clears up a common misconception:
This isn’t about schema migrations, which are used to change the structure of a database. It’s about migrating customer data from various old systems into a new Laravel application – including a new data structure, new requirements, and all the baggage that comes with legacy data. And surprisingly, there’s very little practical guidance out there on how to do this well.
And this isn’t a niche issue: Studies show that over 80% of all data migration projects run into serious trouble (source: LumenData) – often resulting in significant budget overruns and missed deadlines.
The five most common issues that cause migration projects to fail:
1. Different business logic between the old and new systems
2. Inconsistent data sources (API, CSV, dumps, direct DB access)
3. Data inconsistencies that only surface late in the process
4. Old data vs. new requirements – often a poor fit
5. Not enough budget or time allocated for the migration itself
Phillip shares concrete, reusable tips for implementing data migrations with Laravel:
SQL first: Direct access to structured data means better control
SQL first: Direct access to structured data means better control
Chunking over offset: For cleaner, more performant imports
Chunking over offset: For cleaner, more performant imports
Lazy import for small data sets: Conserves resources
Lazy import for small data sets: Conserves resources
Choose your error strategy deliberately: “Revert on fail,” “Skip on fail,” or “Rollback on error”
Choose your error strategy deliberately: “Revert on fail,” “Skip on fail,” or “Rollback on error”
Action pattern for transformations: Reusable in jobs, commands, or the UI
Action pattern for transformations: Reusable in jobs, commands, or the UI
In addition to these general best practices, Phillip introduces two well-thought-out concepts that have proven especially effective in real-world scenarios – and that you can easily adapt to your own upcoming projects:
A pattern for structured data transformation, inspired by Aaron Francis.
The core idea: a manager orchestrates various normalizers, each responsible for cleaning up and standardizing individual fields (e.g., name, date, status).
Advantages:
Scalable and versionable transformation
Scalable and versionable transformation
Reusable across other projects
Reusable across other projects
Fine-grained solution: Each individual component serves one clearly defined purpose.
Fine-grained solution: Each individual component serves one clearly defined purpose.
When legacy data is only accessible via an API, Phillip recommends using an intermediate system – for example, with Laravel Zero.
Instead of importing the data directly into the application, it’s first written to a SQLite staging database – unprocessed, but complete. This approach offers major advantages:
Repeatable migrations, even without API access
Repeatable migrations, even without API access
Improved analysis, querying, and debugging
Improved analysis, querying, and debugging
Version control and easy team sharing
Version control and easy team sharing
Can be combined with other import sources (e.g., CSV)
Can be combined with other import sources (e.g., CSV)
The talk ends with an exciting outlook: How could AI-powered tools like MCP Server help in the future – by analyzing table structures, identifying inconsistencies, or even suggesting migration scripts?
Here’s the full recording of Phillip's talk:
Senior PHP Developer
Phillip Kalusek
Phillip’s open and communicative nature, combined with his PHP expertise, make him a real asset to our team. He contributes his deep Laravel knowledge not only to client projects but also by sharing it with other developers through training sessions.
Ähnliche Blogposts
18.06.2025
Sentry x Nightwatch in comparison
Reliable monitoring is a central component of modern web applications. In Laravel projects in particular, it is crucial to detect errors at an early stage, identify performance problems and be able to react quickly to unexpected behaviour. Two solutions that meet these requirements are Sentry and Laravel Nightwatch. We introduce both.
04.06.2025
The new Certification for Laravel
The Certification for Laravel is back - and better, more modern and more practical than ever before! With fresh questions, a new platform and a clear quality standard - we'll tell you more!
08.04.2025
Review of our Meetup
Laravel Cloud & Laravel 12: Review of our March Meetup
Laravel Cloud and Laravel 12 in focus: At the last DACH Meetup, there were exciting insights into the new releases and their impact on everyday developer life.
10.12.2024
What you should NOT do in Laravel
In our Laravel Meetup in November, we looked at bad practices and programming fails in Laravel together. PHP developer Jure shares 3 examples from the meetup.
12.03.2024
New in 2024
Laravel 11 Release
Laravel 11 is here! Learn all about the latest features, including PHP 8.2 support, improved security, development efficiency and the introduction of Laravel Reverb for real-time WebSocket communication.
Planning your own migration project and looking for expert support?
Get in touch – we’re happy to help.
Contact