How to import a SAF-T file from another program
What is it for?
It brings into the company the data of an accounting SAF-T file generated by another program: chart of accounts, opening balances, customers and suppliers, and journal entries. The file is checked against the official schema and the company's tax number (NIF), the screen shows what it will create, and nothing is saved until you confirm.
When to use it?
- When the previous software exports the accounting SAF-T (accounting type C) and you want to reuse the chart and the journal entries instead of importing them one by one.
- Do not use it for the same file whose opening balances you have already imported by CSV, without switching off Opening balances in the import: they would be doubled.
- Do not use it for files of another NIF without knowing why: the screen refuses them (see “Common problems”).
Where to find it?
Accounting › Configure › Migration and imports › Import SAF-T file. The Accountant does not see the menu.
Before you start
- Your profile is Fiscal officer (or Administrator): it has the “Fiscal Migration / Import” permission and the New button, and can import all the way through.
- The active company (top-right corner) is the one with the NIF in the file.
- The file is XML, up to 50 MB, and is written in the Windows-1252 encoding (the one the Portuguese SAF-T requires). Example used here, made up: a 2025 SAF-T of “Empresa Migração Exemplo, Lda” (NIF 503007773), with 14 accounts, 2 customers, 1 supplier and 3 journal entries (a sale of €1,230.00, a purchase of €615.00 and the receipt for the sale), from the fictitious program “Contabilidade Exemplo”.
- Create the partners and the chart first if you want to control names: the import keeps what already exists (see “Important notes”). In the example, the company already has the Portuguese chart of accounts and the records “Cliente Alfa, Lda” and “Fornecedor Beta, SA”, with the NIFs in the file.
How to use it
- Open the menu and click New. The list shows each import with the file name, the company, the accounting type and the status.
- In SAF-T file, choose the file and click Validate. The screen checks the file against the official schema and fills in Accounting type, Tax number in the file, Company in the file and the period. A file with a problem goes to With errors and nothing is saved; the Report block says how many records were rejected (for example, “File: Rejected 1”), and Open the report by type and result shows the reason for each one. Correct the file in the source program and create a new import.
- With the status Validated, check What to import. Validate switches on only what the file contains: in an accounting SAF-T, Chart of accounts, Opening balances, Customers and suppliers and Entries are switched on, and Products and Sales documents (SalesInvoices) are switched off. Switch off what you do not want to bring and, if you want only part of the year, fill in Import from (date) and Import up to (date).
- Click Preview. The status becomes Previewed and the screen says how many customers, suppliers and accounts are new and how many already exist, how many journal entries it creates, how many were already imported and how many it rejects, the trial balance computed from the file, the taxonomies and whether the file's taxes match the company's (a tax is never created). With the example: “Customers and suppliers: 1 new, 2 already exist. Accounts: 5 new, 9 already exist. Journal entries: 3 to create, 0 already imported, 0 would be rejected (unbalanced or invalid account). Trial balance computed from the file (before confirming): debit 3,075.00, credit 3,075.00.” Check the totals against the trial balance of the previous software.
- Click Confirm the import. At “Nothing was written to the books until now. Create the valid records of the preview? The ones listed as errors are refused and stay in the log with the reason.”, click Confirm. The status becomes Imported and the Report says what was created; with the example, “Partner: Imported 1, Already existing 2 · Account: Imported 5, Warning 9 · Journal: Imported 1 · Entry: Imported 4” (the 3 entries in the file and the opening one).
Expected result
With the example file, in Accounting › Review, in the general ledger:
| Entry | Date | Account | Debit | Credit |
|---|---|---|---|---|
ABR/2024/00001 (opening balances) | 31/12/2024 | 1111 Caixa | €1,500.00 | |
1211 Depósitos à ordem | €20,000.00 | |||
5111 Capital | €21,500.00 | |||
DIV/2025/00001 | 10/03/2025 | 2111 Clientes gerais (Cliente Alfa, Lda) | €1,230.00 | |
7111 Vendas de mercadorias | €1,000.00 | |||
2433 IVA - Liquidado | €230.00 | |||
DIV/2025/00002 | 15/04/2025 | 6211 Serviços especializados | €500.00 | |
2432 IVA - Dedutível | €115.00 | |||
2211 Fornecedores gerais (Fornecedor Beta, SA) | €615.00 | |||
DIV/2025/00003 | 20/05/2025 | 1211 Depósitos à ordem | €1,230.00 | |
2111 Clientes gerais (Cliente Alfa, Lda) | €1,230.00 |
- The journal entries are posted (not in draft), in a new journal, Importado Diversos, created because it did not exist.
- The opening balances in the file become a journal entry in the Opening entries journal, dated the day before the start of the file's period.
- Of the 14 accounts in the file, 5 are created (
1111,1211,5111,6211and7111), with the taxonomy from the file. The other 9 (11,21,51,62,71,2111,2211,2432and2433) already existed in the company's chart and stay as they were, with the chart's name; in the report, each one has the warning “Already exists with another name (…): kept, never overwritten.”. That is why the ledger shows2111Clientes gerais and not “Clientes”, the name in the file. - Of the 3 entities, 1 customer (Cliente Gama, Lda) is created; Cliente Alfa and Fornecedor Beta already existed, by NIF (“Already exists as Cliente Alfa, Lda.” and “Already exists as Fornecedor Beta, SA.”).
- Check the result in the import log and the trial balance.
Important notes
- Accounts that already exist are not changed. An account with the same code but another name keeps the company's name; the warning stays in the report. The type of new accounts is derived from the code: in the example,
1111and1211became “Bank and Cash”,5111“Equity”,6211“Expenses” and7111“Income”. Check it in the list of accounts. Pending validation by a certified accountant: type of imported accounts and SAF-T type of opening entries. - Partners that already exist (by NIF) are not created again: the report shows “Already exists as Cliente Alfa, Lda.”.
- Importing the same file again does not duplicate anything: see “I imported the same file again” in “Common problems”.
- Sales documents, products, accounting mapping and mapping profiles serve invoicing files (SalesInvoices) and were not walked through in this article, which uses an accounting file. Pending validation on screen: import of an invoicing SAF-T, with the Accounting mapping of imported billing and the SAF-T import mapping profiles (Accounting › Configure › System).
- Imported documents are not certified. The sales documents of an invoicing SAF-T do not become documents issued here; for the certified series and documents of the previous software, see the article “How to migrate the series and certified documents from the previous software” (in preparation).
- Unbalanced journal entries pass Validate, but the preview counts them under “would be rejected” and shows each one in Errors and warnings, for example “Unbalanced transaction. Transaction 2025-03-10 DIV D2025-009 of journal DIV (row 2 of the file): debit 1,230.00, credit 1,220.00. Nothing was imported for it; correct the amounts in the system that generated the file.”. If you confirm, the others go in and that one is refused in the report. An entry with an account that the file does not define, however, never reaches the preview: the official schema refuses the whole file at Validate.
Common problems
“The file declares the encoding UTF-8, but the SAF-T (PT) must be written in Windows-1252”
- Symptom: Validate leaves the import With errors, with “File: Rejected 1” in the report. In Open the report by type and result, the message is “The file declares the encoding UTF-8, but the SAF-T (PT) must be written in Windows-1252. Export the file again with that encoding in the system that generated it.”
- What to do: export the file again in the source program with the Windows-1252 encoding. Do not edit the file by hand.
“The file belongs to the tax number … but the company … has …”
- Symptom: “The file belongs to the tax number 503007773 but the company Empresa Migração Documentos, Lda has PT503009997. Select the right company; only a Fiscal Manager can import a file of another tax number, and must say why.”
- What to do: switch to the file's company (top-right corner) and import there.
“… is missing in the file” or “has a problem the Tax Authority will not accept”
- Symptom: messages with the line, column and element of the file, for example “"TaxonomyReference" is missing in the file (… element AuditFile > MasterFiles > GeneralLedgerAccounts)” or “The file has "cliente" where it is not allowed”.
- What to do: the file does not comply with the official SAF-T schema. Give the supplier of the previous software the element and line from the message, and import the corrected file in a new import.
“WARNING: this same file was already imported”
- Symptom: in a new import with a file that was already imported in the company, the preview says “WARNING: this same file was already imported. Records already imported are skipped, nothing is duplicated.”, with “Accounts: 0 new, 14 already exist. Journal entries: 0 to create, 3 already imported” in the example.
- What happens if you confirm: nothing is created again. The report says “Partner: Already existing 3 · Account: Already existing 5, Warning 9 · Entry: Already existing 4”, and the company keeps the same 4 journal entries (each with “Already imported.” in the report and the opening one with “The opening entry was already imported.”).
- What to do: if you only wanted to check, click Delete the import before confirming. If the previous software corrected the file, the entries that already went in are not replaced: correct them here, with the certified accountant.
I want to undo an import
- Before confirming: click Delete the import and confirm; nothing had been written to the books. The import gets the status Deleted and the menu list no longer shows it (filter Hide deleted).
- After Imported: Delete the import asks for confirmation (“Delete this import? Only possible while no document created by it was published; the drafts it created are deleted too.”) and refuses, because the imported entries are posted: “This import cannot be deleted. 4 document(s) were already published (DIV/2025/00001, DIV/2025/00002, DIV/2025/00003, ABR/2024/00001): published documents are never deleted; …”. Keep the import as history, use the reversal on each entry to undo and talk to the certified accountant.