---
title: "Migration to the community einvoicing module"
weight: 90
description: "How to switch from the Facturx module to the official einvoicing module maintained by the community, and what is kept or to be redone."
source_hash: "59e65b7d"
---

# Migration to the community einvoicing module

## Why this page

The code of the **Facturx** module was donated to the Dolibarr community. It served as the starting point for an official module, maintained by the association and its contributors, published under the name **einvoicing** (formerly `pdpconnectfr`).

This page explains how to switch from Facturx to `einvoicing` cleanly, what is kept automatically and what you must redo by hand.

The `einvoicing` module can be downloaded here:

- Dolistore: <https://www.dolistore.com/product.php?id=3309>
- Source code: <https://github.com/Dolibarr/dolibarr-community-modules> (`einvoicing` folder)

> **Key point:** the switch happens in this order: first install and **enable** `einvoicing`, then run the **data transfer** from the Facturx Migration tab (both modules are then active at the same time, for the duration of the transfer only), and finally **disable** Facturx. During the short window where both modules are active, do not generate or send any invoice: they both hook into PDF generation.

## What each module does

The two modules do not cover exactly the same scope. It is important to understand this before migrating.

| | Facturx (this module) | einvoicing (community) |
|---|---|---|
| Factur-X / CII metadata in the PDF | Yes (core of the module) | Yes (FacturX protocol) |
| Chorus Pro fields on the invoice | Yes | Yes (same fields) |
| Connection to an access point (SuperPDP) | Yes, light connector | Yes, full connector |
| Receiving supplier invoices | Yes, via import queue | Yes, via dedicated tables (flows, lifecycle) |
| Third-party routing (PDP identifier) | `peppol_id` field on the third party | Dedicated routing table (several identifiers per third party) |
| Invoice lifecycle tracking | Limited | Detailed (statuses, messages, history) |
| Other platforms (ESALINK, etc.) | No | Yes |

In summary: `einvoicing` is more ambitious and more complete on the approved platform (PA/PDP) side. Facturx remains focused on Factur-X PDF generation and a simple SuperPDP connection.

## What is kept automatically

Good news: the **Chorus Pro** data entered on your invoices is kept as is. Both modules use exactly the same extra fields (same technical names), so no data is lost during the switch:

- Executing service (Chorus service code)
- Commitment / contract number
- Commitment code
- Invoice Chorus identifier

On the einvoicing side, these fields are driven by the **EINVOICING_USE_CHORUS** option. Remember to enable it if you use Chorus Pro, otherwise the fields remain hidden (the data, however, stays in the database).

## What you must redo by hand

Some information specific to Facturx has no direct equivalent in einvoicing, or is stored differently. Point 1 (third-party PDP identifiers) is **automated** by the Migration tab ; points 2 to 4 remain to be redone manually.

### 1. Third-party PDP identifier

In Facturx, a third party's routing identifier (SIREN, Peppol identifier...) is stored in the **`peppol_id`** extra field on the third-party card because the FacturX module is iso-compatible on these fields with the Peppol module also published by CAP-REL.

In einvoicing, this information goes into a **dedicated routing table** (`llx_einvoicing_routing`), which allows several identifiers per third party, a default identifier, a source (manual / automatic / synchronization), etc.

This transfer is **automated** by the Migration tab of the Facturx module (see the procedure below): it reads each third party's `peppol_id` and creates the corresponding routing entry in einvoicing. The operation is safe and replayable (an identifier already present is ignored, no Facturx data is modified). It assumes that einvoicing is already installed and enabled, so that its routing table exists.

### 2. Access point configuration (SuperPDP)

The SuperPDP connection exists in both modules, but the configuration is not transferred: the keys, OAuth tokens and settings are stored under different constant names (`FACTURX_AP_*` on the Facturx side, `EINVOICING_SUPERPDP_*` on the einvoicing side).

You must therefore **reconnect SuperPDP from the einvoicing configuration** (re-enter the client/secret pair, new OAuth authorization). It is not a simple variable rename: redo the connection step from the community module's configuration screen.

### 3. Factur-X specific fields

These Facturx fields have no automatically carried-over equivalent:

- **Buyer order reference** (`fx_buyer_order_ref`)
- **Chorus target** (`fx_chorus_target`)
- **Payer party** (`facturx_payer_id`, useful in EXTENDED / CTC-FR profile)
- **Peppol VAT exemption** (`peppol_vat_exemption`) and its code dictionary

If you use them, note their values before migration. Depending on einvoicing versions, the payer party and VAT exemption handling may be done differently (directly in the emission protocol).

### 4. Supplier invoices pending import

Facturx stores pending imports in its own queue (`llx_facturx_apimport`). einvoicing uses its own tables (`llx_einvoicing_document`, `llx_einvoicing_call`).

Before switching, **process or clear the Facturx import queue** (validate or reject the pending supplier invoices). What remains in the Facturx queue will not be picked up by einvoicing.

## Recommended migration procedure

Perform these operations outside production hours, after a **full backup** (database + documents).

1. **Backup** of the database and the documents directory.
2. **Note your Facturx configuration**: Factur-X profile used, SuperPDP settings, Chorus options. A screenshot of each configuration page is enough. The Facturx Migration tab also displays an overview (number of third parties to transfer, pending imports, etc.).
3. **Process the supplier invoice import queue** of Facturx (nothing pending).
4. **Install and enable the einvoicing module.** This is what creates its routing table, needed for the transfer in the next step.
5. **Run the data transfer**: in Facturx, go to Configuration - **einvoicing Migration** tab, then click **Transfer routing identifiers to einvoicing**. Your third parties' PDP identifiers (`peppol_id`) are copied into einvoicing's routing. The operation is replayable without risk of duplicates.
6. **Disable the Facturx module** (Home - Configuration - Modules). Do not uninstall it yet: as long as it is only disabled, its fields and data remain in the database, which leaves you an exit door.
7. **Finalize the einvoicing configuration**:
   - **Enable the Chorus option** (`EINVOICING_USE_CHORUS`) if you use Chorus Pro. Check that the Chorus fields of your invoices are indeed filled in (they should be, same fields).
   - **Reconnect SuperPDP** from the einvoicing configuration.
   - **Check the routing** of the third parties transferred at step 5.
8. **Test** on one invoice: Factur-X PDF generation, test send to the access point, reception. Only uninstall Facturx once these tests are conclusive.

## Data mapping table

| Facturx data | Facturx location | einvoicing location | Carried over |
|---|---|---|---|
| Chorus service code | `d4d_service_code` (invoice) | `d4d_service_code` (invoice) | Automatic |
| Commitment / contract number | `d4d_contract_number` (invoice) | `d4d_contract_number` (invoice) | Automatic |
| Commitment code | `d4d_promise_code` (invoice) | `d4d_promise_code` (invoice) | Automatic |
| Invoice Chorus identifier | `d4d_chorus_id` (invoice) | `d4d_chorus_id` (invoice) | Automatic |
| Third-party PDP identifier | `peppol_id` (third party) | table `llx_einvoicing_routing` | Automated (Migration tab) |
| Document identifier at the access point | `facturx_id` (invoice) | table `llx_einvoicing_document` | Not carried over (recreated on use) |
| Buyer order reference | `fx_buyer_order_ref` (invoice) | no direct equivalent | Manual if needed |
| Chorus target | `fx_chorus_target` (invoice) | no direct equivalent | Manual if needed |
| Payer party | `facturx_payer_id` (invoice) | handled by the emission protocol | To check depending on version |
| Peppol VAT exemption | `peppol_vat_exemption` + dictionary | no direct equivalent | Manual if needed |
| SuperPDP configuration | constants `FACTURX_AP_*` | constants `EINVOICING_SUPERPDP_*` | Manual reconnection |
| Supplier import queue | `llx_facturx_apimport` | `llx_einvoicing_document` / `call` | To be cleared before migration |

## Frequently asked questions

**Can I keep both modules active in parallel?**
Only for the duration of the transfer (steps 4 to 6). Both add the same Chorus fields and both intercept invoice PDF generation: during this short window, do not generate or send any invoice. Once the transfer is done, disable Facturx and keep it **disabled but installed** as a safety net ; only uninstall it after validation.

**Will I lose my old already generated Factur-X invoices?**
No. The PDFs already produced (with embedded Factur-X metadata) remain in your documents. The migration only concerns the generation of future invoices and the configuration.

**Will the Chorus data of my existing invoices be visible in einvoicing?**
Yes, because they are the same technical fields. Just enable einvoicing's Chorus option to display them.

**Where to download the einvoicing module?**
It is published by the Dolibarr community on the Dolistore: <https://www.dolistore.com/product.php?id=3309>. Its source code is hosted on <https://github.com/Dolibarr/dolibarr-community-modules>, in the `einvoicing` folder. Refer to these two sources for the recommended version on your Dolibarr version.

**Does CAP-REL provide after-sales service for the community module?**
Of course, just like all dolibarr features CAP-REL provides after-sales service and can support you, just make sure you have an active maintenance contract or <a href="https://shop.cap-rel.fr/cat/product/SAV">a few prepaid service hours</a>.
