Skip to content

Replacing your legacy system: how does all your data come along?

The contract for the new system is signed, maybe Shopify instead of the old shop, maybe industry software instead of the custom build. Now the new vendor asks for an export, and suddenly it’s unclear where customers, orders, documents and consents actually live and who will get them out. If something is missing on cutover day, you only notice when a customer can no longer log in or someone looks for an old invoice.

By Dimitri König8 min read

When a legacy system is replaced, the new vendor usually brings an import format, but rarely the export of the old data. The export is built by whoever knows the legacy system or works their way into it. This also applies when a third party delivers the new system: they know what they can receive, not what’s inside your old system. That’s why every migration starts on the side of the legacy system.

Which data lives where and where it gets stuck

Data type Where it usually lives Typical migration pitfall
Customers and accounts Tables for customers, users and addresses Duplicates, several addresses per customer, business and private accounts mixed together
Passwords As a hash in the user table, never in plain text The new system doesn’t know the hashing method. Shopify, for example, doesn’t accept passwords in a CSV customer import
Orders and invoices Order, line item and status tables, often plus PDF files The history doesn’t come along; Shopify doesn’t take over orders via the customer CSV. The retention obligation remains
Files, images, documents In the file system, for example in an upload folder, not in the database The database export only contains paths. The files are missing, or the paths no longer match
Text with umlauts and special characters Database columns with their own character encoding Double-encoded umlauts like “ü” instead of “ü”. MySQL columns with utf8mb3 can’t store many emojis at all
Settings and custom fields Serialized PHP values or JSON in a text column PHP stores the length of each string along with it. If a search-and-replace or a re-encoding changes it, unserialize() only returns false
History and notes Log and history tables, comments, status changes Only the current state is taken over; who changed what and when gets lost
Newsletter subscribers Separate table or external email service Consents without a timestamp and source, unsubscribed contacts turn back into subscribers
Page addresses Routing, slugs, SEO fields Old links lead nowhere. Google recommends permanent redirects, as a rule for at least a year
Numbers and references Customer and invoice numbers, IDs for ERP, accounting and payment providers New numbers break reconciliation with accounting and open payments

For migrating passwords there’s a middle ground if the new system plays along: it takes over the old hashes, verifies the password using the old method at the next login and then stores it again. In PHP applications, the function password_needs_rehash() helps here; it detects whether a hash still matches the desired method. If that isn’t possible, your customers need an invitation to set a new password, and that belongs in the plan, not in the week after cutover.

Data migration in 12 steps

A complete data migration from the legacy system follows these 12 steps:

  1. Create a data map. What types of data are there, where do they live (database, file system, external services), and who is responsible for them on the business side?
  2. Decide on the scope of the migration. What comes along, what gets archived, what gets deleted? Write down the reasons.
  3. Clarify the target format. Which fields, required fields and import paths does the new system offer? Get this from the new vendor in writing.
  4. Write the field mapping. Field by field from old to new, including conversions such as status, countries, tax rates and units of measure.
  5. Take a full backup. Database, files and configuration of the legacy system, stored off the server, with the restore tested once.
  6. Clean up the data. Remove duplicates, test records and orphaned entries, in the legacy system or in the export script, never by hand in the target system.
  7. Build the export as a script. Repeatable instead of manual: every run produces the same result from the same state.
  8. Trial export to a test environment. Complete data into the real target system, but into a test instance that only the people doing the checks can access.
  9. Reconcile old and new data. Counts, totals and deviations go into the reconciliation log. Every deviation needs a reason.
  10. Business sign-off by the people who work with the data every day. Spot checks such as three well-known customers, the latest order, an old invoice and a known special case.
  11. Cutover day with a delta export. Set the legacy system to read-only, export all changes since the last trial run, reconcile and switch over. Redirects and integrations move on the same day.
  12. Shut down the legacy system in an orderly way. A readable archive for everything that must be retained, then delete the servers, databases, export files and backups nobody needs anymore. Record what was deleted when.

Template: reconciliation log

The reconciliation log is your proof that the migration is complete. One row per data type, filled in after every trial run and on cutover day:

Object Count old Count new Total Deviation Reason
Customers –
Customer accounts with login –
Orders (state the period) Gross order value
Order line items Quantity
Invoices Invoice amount
Products and variants –
Files and images Total size
Newsletter subscribers with consent –
Redirects –
  • Total: a control value in the reconciliation log that can be checked independently of the count. If the count matches but the total doesn’t, something was transferred incorrectly along the way.
  • Deviation: count old minus count new; for totals, the difference.
  • Reason: for example “test orders deliberately not migrated”. A deviation in the reconciliation log without a reason is an error until proven otherwise.

When the legacy system has no export

If the legacy system has no export, the most reliable route is direct access to the database, plus the files on the server. Second comes an API of the legacy system, if there is one. If the legacy system offers neither, what’s left is reading out your own website or interface with a scraper. That’s only an option for your own data that you’re authorized to access. Getting around access restrictions or collecting other people’s content isn’t part of it.

From practice: migrations in the portfolio

I’ve built several data migrations from legacy systems, the export from the legacy system as well as the import into the new system. None of them was a replacement where a third party delivered the new system. The export side is the same, though: find the data, prepare it, transfer it repeatably, check it.

  • CMS migration to TYPO3: a multilingual website with thousands of pages. The third-party CMS offered neither an API nor database access, so a custom scraper captured content, hierarchy, translations, images and files, and scripts converted them into TYPO3 content elements.
  • TYPO3 shop to Shopware: all customer data and newsletter subscribers moved along so customers could keep using their existing accounts. The import scripts from FileMaker skip incomplete products and abort if an export is faulty.
  • Multi-site to TYPO3: page structures, content and user permissions taken over from another CMS into a central TYPO3 installation.
  • Akeneo import from SAP: not a move, but the same logic as in reconciliation. Products missing from the export are deactivated, and faulty records stay unchanged instead of partial data being written.

Law and data protection, briefly

Three legal points belong in every plan for a data migration in Switzerland; they don’t replace legal advice:

  • Proportionate and tied to the purpose: Under Art. 6 para. 2 and 3 of the Swiss Federal Act on Data Protection (FADP), processing personal data has to be proportionate and fit the purpose for which the data was collected. For the migration, that means only taking along what the new system needs for that purpose, and restricting test environments to the people doing the checks.
  • Destroy what is no longer needed: Under Art. 6 para. 4 FADP, personal data is destroyed or anonymized as soon as it’s no longer needed for the purpose. After the migration, that also covers old servers, export files and backups.
  • Retain what must be retained: Under Art. 958f of the Swiss Code of Obligations (CO), business records and accounting vouchers have to be kept for ten years and must be able to be made readable again at any time. What falls under this in your case is something to clarify with your accountant.

Whether and under what conditions the previous vendor has to hand over data, code and documents is governed by your contract. Have a lawyer look at that.

Who builds the export

At Unique-P, data export, field mapping and reconciliation are part of Legacy application migration, even when a third party delivers the new system. If it’s still open whether the legacy system should be replaced at all, Modernize or rebuild helps with the decision. If it has to keep running for a while until the replacement, Legacy system until replacement shows where investing still pays off. And to make the next switch easier, independence from the vendor belongs in the contract for the new system from the start.

Sources

  1. [1]Bundesgesetz über den Datenschutz (DSG), Art. 6 · Fedlex, Schweizerische Eidgenossenschaft
  2. [2]Obligationenrecht (OR), Art. 958f · Fedlex, Schweizerische Eidgenossenschaft
  3. [3]Importing and exporting customers · Shopify Help Center
  4. [4]The utf8mb3 Character Set · MySQL 8.4 Reference Manual
  5. [5]unserialize · PHP Manual
  6. [6]password_needs_rehash · PHP Manual
  7. [7]Site moves with URL changes · Google Search Central

Frequently asked questions.

Does the previous developer have to help with the export?

The previous developer’s help with the data export is useful, but it isn’t a requirement. With access to the database, server and files, the export can be built without them. Whether they have to hand over data and documents is a question of your contract, which you should have clarified by a lawyer.

Developer can’t be reached: immediate actions

Can our customers keep their current passwords?

Whether your customers can keep their current passwords after the data migration depends on the new system. Only hashes are stored, never the passwords themselves. If the new system can verify the old hashing method, the hash can be converted to a current method at the next login. Not every system can do that; Shopify, for example, doesn’t accept passwords in a CSV customer import. Then your customers get an invitation to set a new password. Plan this email from the start.

What do we do with data the new system doesn’t need?

Data the new system doesn’t need shouldn’t just be left on the old server. Under Art. 958f of the Swiss Code of Obligations (CO), you have to keep business records and accounting vouchers for ten years, in readable form, even if the new system doesn’t take them over. Under the Swiss Federal Act on Data Protection (FADP), personal data no longer needed for any purpose has to be destroyed or anonymized. What belongs where in your case is something to clarify with your accountant.

How long does a data migration take?

How long a data migration takes depends less on the amount of data than on the number of data types and special cases. Plan at least one full trial run with reconciliation and business sign-off before cutover day. After that, the export itself runs as a script and can be repeated as often as needed.

Are we allowed to scrape our data from the old system?

Scraping, meaning automated reading of the user interface, can be the only way out of the old system for your own content that you’re authorized to access, for example when the old CMS offers neither an export nor database access. For other people’s data or to get around access restrictions, it’s out of the question. If in doubt, clarify it with the previous vendor first.

Example: CMS migration via scraper