---
title: "epilot data migration for contacts, contracts and documents"
description: "Move contacts, contracts and attachments from a legacy system into epilot. Choose an import method, check the links and test the final changes before cutover."
author: "Marcel R. G. Berger"
publisher: "DigitalFreedom Global LLC"
language: "en"
canonical_url: "https://epilot-berater.de/en/epilot-data-migration/"
translation_url: "https://epilot-berater.de/epilot-datenmigration/"
---

Legacy data

# How do you move contacts and contracts from a legacy system into epilot?

An epilot data migration transfers contacts, contracts and documents from a legacy system and links them using unique keys. If a customer has an electricity contract and a gas contract, customer service must be able to find both under the same contact after cutover and open the right document from each contract.

[Book a call](https://epilot-berater.de/en/#book)

Last updated: 27 November 2026

## The short answer

- Contacts and contracts can be imported into epilot from one CSV file when the field mapping defines both entity types and their relationship.
- For regular updates from billing, an integration can use the Entity API to create or update records based on an agreed key.
- A relation in epilot points to the linked record by its internal ID.
- A sandbox test should include a customer with several contracts, a missing reference and a correction made after the first import.
- Before sign-off, the business team should reconcile changes made between the first extract and cutover against the legacy system.

## When is a CSV import sufficient and when do you need an integration?

CSV is a good starting point for a one-off import with a known set of columns. If billing sends corrections regularly, the import must still find the same contact after a name change. Test that requirement when choosing the import method.

An energy supplier might provide its active supply contracts in a file, while billing continues to maintain the billing address after cutover. Agree with customer service how soon a changed address needs to appear in epilot. That tells you whether subsequent file imports will suffice or whether you need an integration.

Import methods for contacts and contracts

| Import method           | When it fits                                                                  | What to establish first                                                                                                                                  |
| ----------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CSV for one entity type | The business team supplies a contact list, for example.                       | Map the source columns to the contact fields. Save the file in UTF-8 and check umlauts and leading zeros.                                                |
| CSV with relations      | One file contains contract data and identifies the customer on each contract. | Check with epilot which mapping is available for your organisation. It must identify both the contact and the contract and define the link between them. |
| Entity API              | A source system sends individual records or ongoing changes.                  | Decide which field identifies an existing contact. An upsert creates a record or updates the matching record.                                            |
| Batch API               | An integration needs to send several epilot API calls in one request.         | Inspect the response to each call. A completed job can contain individual failures.                                                                      |
| Submission API          | You want to capture incoming source data before processing it.                | Define how an automation will turn the submitted data into the contacts and contracts you need.                                                          |

## Which key links a contract to the right customer?

Use a separate, stable key from the system of record for each contact and each contract. A customer number works for the contact if it identifies exactly one customer in that system. Each of that customer's contracts also needs its own contract number or another unique contract key.

The external key comes from the legacy system. For example, the field mapping can put the customer number in external_id. The internal ID of an epilot record is stored in \_id. When you create a relation with the Entity API, entity_id points to the related record. Keep a record of which epilot ID belongs to each legacy key.

Check who issued the number. If two billing systems issue the same customer number, the mapping must take the source system into account. Resolve these cases with the business team before import. A shared family address or a similar surname does not establish who holds a contract.

Fictional test data for three contracts. K0017 is the only customer in the contact extract.

| Legacy contract  | Customer key | Expected result                                                                                                                                       |
| ---------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| V101 electricity | K0017        | The electricity contract belongs to contact K0017.                                                                                                    |
| V102 gas         | K0017        | The gas contract points to the same contact. This customer has one contact record and two contracts.                                                  |
| V103 electricity | K0080        | The customer reference is unresolved. The business team checks whether the contact is missing from the extract or the contract carries the wrong key. |

## In what order should you migrate the data?

Let the relationships in the target data determine the order. If contacts and contracts arrive separately, start with the contacts. A file import with the right mapping can also create related records together and link them.

1. Define the scope. Ask the business team whether ended supply contracts need to be available in epilot at launch. Record the point in time the extract represents and the expected contacts and contracts separately.
2. Document the source column, target field and key for the data you need. For instance, establish whether the address on a contract row identifies the supply point or the billing recipient. Check a case where the two addresses differ.
3. If the data arrives separately, import the contacts first. Retrieve their epilot IDs. Resolve missing or ambiguous keys before you process those customers' contracts.
4. Import the contracts and link each to its contact. Open a customer with several contracts. For each one, compare the contract number, supply point and contract holder against the source.
5. Link documents once you know which contracts they belong to. List unresolved links with their source keys and the reason each failed. The business team can then check an individual contract and approve it for another import.

## How do you attach each document to the right contract?

With the File API, you upload the document, save it as a file in epilot and link its file ID to the contract. Use a file attribute or the default \_files attribute. When extracting documents from the archive, keep each document key together with its contract key.

For a spot check, use two contract confirmations with different contents but the same filename. Open each from its contract and compare the contract number in the PDF with the one in epilot. Checking filenames alone would miss a swap.

If the document is to stay in the existing archive, epilot also documents how to retrieve an externally stored file using custom_download_url. Agree with the archive operator how to make that file available. Before sign-off, check that an authorised employee can open it and that access restrictions work.

## How can the business team tell whether a test migration worked?

A test run is meaningful if you define in advance which records and links you expect to see for each case. Use fictional data in an epilot sandbox. The sandbox is a separate organisation with its own data and configuration.

Start with the unresolved customer reference in the sample data and flag V103 for review. Then add the confirmed contact or correct the source key. After the next run, check that V103 is linked correctly and see whether anything changed on V101 or V102.

- Check record counts. Count distinct customer keys and contract numbers separately. In the example, two contract rows with the same customer key count as one customer.
- Test an update. Correct the spelling of a name while keeping the customer number. You should find the same contact with the corrected name and both contracts still linked.
- Review failures. Record the affected key when an API call fails. Before retrying, check which records and relations already exist.

## How do you capture changes up to cutover?

A delta is the set of changes since a recorded point in time. Agree with billing how it will supply new contracts, corrections and contract terminations from that point. The time of the extract and the date a supply contract ends serve different purposes.

Use a customer who moves home between the first import and go-live as an acceptance test. The contract at the former supply point receives an end date, and a contract is added for the new supply point. Check both changes under the same customer and compare the effective dates with billing.

For cutover, agree where staff will record changes, until what time and who will produce the final change extract. If customer service stays open during the switch, agree where staff will log new requests and who will enter them afterwards.

Sign off once the final extract has been reconciled and the business team has assessed the outstanding cases. Before cutover, also agree what to do if a contract is linked to the wrong customer. The handover record should name who can halt the switch and say which system customer service will then use.

## Who handles rollout, integration and business sign-off?

epilot's consulting team handles the rollout and is the contact for the standard scope. Ask which import configuration your organisation will use for contacts and contracts. Have the billing and customer service leads confirm how the source data maps to those records.

An external integration partner can connect the ERP, billing or grid system. If your legacy system provides contract changes through a REST API, the partner can map the source fields to epilot and supply the data through the interface. The business team decides which customer holds each contract.

## Frequently asked questions about epilot data migration

### Can I import contacts and contracts from the same CSV file?

Yes, if the field mapping defines the entities involved, their keys and their relationship. Test it with a customer whose number appears on several contract rows. After import, those contracts should all link to the same contact.

### How do I avoid duplicate contacts when I repeat an API import?

For the upsert, specify the same stable key under unique_key that you used for the first import. epilot recommends making synchronous calls one after another for the same key. If two upserts run concurrently, both can create a new contact.

### Why is a leading zero missing from a customer number?

Check the value in the original extract and in the finished import file. Treat an identifier such as 0017 as text throughout preparation. Check in the source system whether 0017 and 17 refer to the same customer.

### How can I tell whether every call in a batch import succeeded?

Check the HTTP status and response body for each call. The Batch API can mark a task as finished even when the call returns an error. Reconcile the affected keys against the target records before repeating a call.

### Does the entire document archive have to move into epilot at cutover?

The File API supports files stored in epilot and references to externally stored documents. Decide for each document type where to keep the original and how customer service will access it. Test retrieval from the relevant contract.

### How do I estimate the time needed for cutover?

Use a trial run to measure extraction, import, error resolution and business reconciliation. Allow for the final delta and the availability of the people responsible for sign-off. Use those figures to set the cutover window for your data.

## Read on

- [Connecting ERP and billing to epilot](https://epilot-berater.de/en/epilot-integration/)
- [Making contracts available in the epilot customer portal](https://epilot-berater.de/en/epilot-customer-portal/)
- [Providing data from other systems via REST](https://epilot-berater.de/en/blog/rest-api-data-for-epilot/)
- [Handling errors in live integrations](https://epilot-berater.de/en/blog/epilot-integration-operations/)

## Sources

- [epilot Dev Center, Entity Tables](https://docs.epilot.io/docs/entities/entity-tables/)
- [epilot Dev Center, Integration Toolkit API update on file imports and templates](https://docs.epilot.io/api/changelog/api/changelog/2026-10-29-integration-toolkit-api/)
- [epilot Dev Center, Entity API](https://docs.epilot.io/docs/entities/entity-api/)
- [epilot Dev Center, Relations](https://docs.epilot.io/docs/entities/relations/)
- [epilot Dev Center, Search Indexing Guarantees](https://docs.epilot.io/docs/entities/indexing-guarantees/)
- [epilot Dev Center, Batch API](https://docs.epilot.io/docs/integrations/batch-api/)
- [epilot Dev Center, Submissions](https://docs.epilot.io/docs/journeys/submissions/)
- [epilot Dev Center, Mapping Examples](https://docs.epilot.io/docs/integrations/integration-toolkit/mapping-examples/)
- [epilot Dev Center, File API](https://docs.epilot.io/docs/files/file-api/)
- [epilot Dev Center, Sandboxes](https://docs.epilot.io/docs/blueprints/sandboxes/)

## Which data does your billing system need to send to epilot?

Bring an anonymised example of a contact with several contracts. epilot-berater.de provides remote support for custom REST interfaces and third-party system integrations for energy suppliers and grid operators in Germany and Austria.

[Book a call](https://epilot-berater.de/en/#book)
