◆IKORG

← Practice · October 22, 2026

Document numbering went wrong in 1C: bulk import pitfalls

Why restoring accounting records creates duplicate numbers, data exchange overwrites documents, and bank payments leave false outstanding balances — and what to check before importing.

10 min read1C

When document numbering goes wrong in 1C, the instinct is to find a setting and put the next number back where it belongs. But during a bulk restoration, old documents return to the database while employees create new ones and data exchange sends records to the accounting database. Numbers overlap, records get overwritten, and repeated imports add duplicates. One setting will not untangle this.

We encountered this while restoring accounting records for a transport company: five legal entities, with 1C running on an in-house server. Ransomware encrypted the server along with the backup drive inside it. We set up a new server from scratch and restored the operational, industry-specific database from a backup dated roughly the end of April. May–September were empty. We also rebuilt the accounting database using sales ledgers, OCR-processed scans, and electronic document exchange. There is no decryptor — we restored the records from surviving sources.

Let’s go through the mistakes in this restoration: numbering, duplicate trips, data exchange, incoming bank payments, and server temporary files. The full story is in the case study on restoring accounting records after ransomware. Here, the main question is practical: how to bring documents back without bringing a new headache along with them.

Why document numbering went wrong in 1C

In this database, the number was determined as “maximum + 1” within a prefix, with numbering scoped to the year. The prefix consisted of two letters for the organization and two letters for the database. There is no separate counter: only a document with a higher number advances the next number. Adjusting a counter would be convenient — if only we could find one.

While an employee creates a new document, the import restores records for the missing period. Two streams meet in one database. If we preserve old numbers while normal work continues, collisions appear.

Meanwhile, identical numbers can belong to different transactions, and different numbers can belong to the same trip. Fixing numbering and finding transactions entered more than once remain separate tasks.

Before making corrections, we need to establish:

With several legal entities, an unfiltered combined list can easily be misleading. First, we look for collisions within the relevant numbering scope, then examine the contents.

Restoring document numbering in 1C 8.3 requires an agreed procedure: which numbers we retain from the source, how we resolve conflicts, and when users continue entering documents. The highest number in an arbitrary list will not answer those questions.

Why data exchange with the accounting database overwrites restored documents

In this case, data exchange ran from the operational database to the accounting database. We imported restored documents into the accounting database while new documents appeared in the operational database — with the same numbers. During export, they overwrote the restored records: three documents were overwritten. The operational database was unaffected.

A successful import thus turned out to be only an intermediate result. The next exchange updated records according to its own rules and overwrote the restored data. That means we need to check the entire path: retrieving data from the accounting database, creating documents in the industry-specific database, establishing links, and running the subsequent exchange. At each stage, we need to know which database is the source and which fields may be updated.

The 1C administrator’s conclusions were straightforward. We must not import the same document into both the operational database and the accounting database: data exchange will bring the two copies into conflict. Numbers do not change on a repeat import. The safest approach is to use a different database prefix for restored documents so that their numbers do not overlap with new ones.

Before a bulk import, we should agree on:

If data exchange or entry of certain documents needs to be paused, we coordinate this with those responsible for the database: stopping it without agreement also disrupts work.

We test on a small, agreed subset of the data. We inspect the documents after import and after data exchange. Only the full cycle will show whether the restoration result holds.

How to find duplicate documents in 1C after restoration

Identical numbers are only part of the picture. Finding documents that describe the same business transaction matters more.

For the transport company, we used a straightforward criterion: one vehicle with one driver cannot make two identical trips on the same date. We marked the duplicate records we found for deletion.

The key phrase here is “two identical trips.” A vehicle and a date alone are not enough to establish an error. An automated search collects suspicious records; a review determines whether they repeat the same transaction.

The review procedure is:

Marking a record leaves room to review the decision before physically deleting it. In this case, we performed no destructive actions without the manager’s decision and logged every action.

Duplicates with linked records need particular attention. If we keep one order while a payment still points to its duplicate, we have merely tidied up the list. For the accounting records to be correct, we need to fix both the records themselves and the links between them.

How to transfer sales documents from the accounting database to the operational database

The restored accounting database became the source for industry-specific records. We converted about 2,500 sales documents from 1C:Accounting into orders, service completion certificates, and VAT invoices in the operational database, without manually retyping them.

The accounting and industry-specific configurations represent the same transaction using different documents. The transfer therefore requires us to restore fields and links: which certificate belongs to which order, and which documents already exist.

This is especially important when rerunning an import after a failure. The import routine must distinguish missing records from those already restored, or the import itself will start producing duplicates.

We check the result by comparing source documents with the created records, reviewing omissions and ambiguous matches separately. The total count shows the volume of work; the correctness of the links needs a separate check.

We restored trip sheets from scanned driver reports: we linked existing orders and created missing ones. Details are in the article on how a neural network turns report scans into 1C trip sheets. Sources need to complement one another, or duplicate orders will appear where they overlap.

Why importing a bank statement into 1C 8.3 leaves outstanding balances

After restoring the orders, we needed to reconnect them to the money. We reviewed about 1,250 incoming bank payments and linked them to orders. We reliably matched about 960 using the invoice number in the payment description. The rest required other criteria.

We used the invoice number, the amount, and an “oldest to newest” rule. This helped allocate incoming payments, but errors in payment descriptions remained.

If a customer specifies the wrong invoice, one order ends up overpaid and another underpaid. The money is in the accounting records, but its allocation does not reflect the actual settlement. That is why importing a bank statement into 1C 8.3 ends with checking links and balances. Otherwise, the manager will see an outstanding balance caused by an incorrect payment description.

In this case, we resolved the discrepancies with a “paid according to reconciliation statement” flag. We set it on 339 orders. This recorded the reconciliation result in the operational database; the method is not universal across other configurations. The original payment description remained unchanged.

When automatic matching produces an ambiguous result, a person steps in. A matching amount alone is not enough to allocate a payment.

There were other cases too. We reassigned 19 payments from unposted or duplicate orders, splitting each payment into line items across several invoices. We posted 41 orders previously created “to match a payment,” following the manager’s rule: if there was a payment, post the order. We could not post four orders because of the cutoff date that blocked changes to a closed period. We should check that date before a bulk import.

When reviewing a statement, we separately examine:

It helps to look at overpayments and underpayments together: these apparently different problems may share a cause.

How to check VAT after transferring documents

After restoring the documents and allocating payments, we had one more task: we aligned VAT rates in 242 documents with the accounting database.

In this restoration, the accounting database was the surviving data source, so we checked the operational database against it. It is easy to mistake a populated field for a verified one, but those are different states.

We should check VAT alongside document contents, links, and payments. Later, once users are actively working with the restored records, discrepancies become harder to investigate.

Automated comparison finds differences. If the source does not provide an unambiguous answer, the responsible employee decides how to handle the disputed transaction.

Why the import routine stopped compiling

One technical error came down to a variable name: “И” or “В”. In 1C code, these names conflict with language constructs, and the entire module stops compiling. A questionable saving in letters.

From the user’s perspective, the effect seems disproportionate: we changed a small fragment, and the entire routine stopped working. Yet the place to look for the cause is the variable name, even if the transfer logic is correct.

Before a bulk run, we check compilation and execution on a limited dataset. We give variables clear names that reflect their purpose: document, order, row.

If we fix the routine after an error, we check whether the previous attempt managed to write any documents before running it again. A runtime error may have occurred after some changes had already been made.

“File not found v8 tmp”: what to check and how rphost fits in

Another trap is the temporary files belonging to the user account that runs the 1C server. We must not clean them up while it is running: the application may need them right now. The cleanup is diligent but poorly timed.

In this case, the CRM reported “File not found …v8_*.tmp”. Restarting the rphost worker process cleared the error.

If you are searching for “what is rphost,” it is a 1C server worker process. It handles user activity and executes server code. We need to coordinate a restart with ongoing work, especially during a document import.

“Temporary” describes a file’s purpose; it does not grant permission to delete it at any moment. With this error, we first establish whether a cleanup took place and whether it affected the 1C service account. A restart helped in this case; a similar message in another situation may have a different cause.

What to check before a bulk import into 1C

This checklist connects the technical run with verification of the accounting records. It is best to go through it before questionable decisions turn into thousands of records.

Here, we did all the work remotely through an intermediary server, logging every action. Local work requires the same clarity: what we changed, on what basis, and which questions remain open.

Frequently asked questions

Can we just set the next document number to the required value?

In this database, the number was determined as “maximum + 1” within the organization and database prefix, with numbering scoped to the year. There is no separate counter. We need to start with existing numbers and the way new documents are created.

Do identical numbers mean the documents are duplicates?

They are a reason to investigate. We identify a duplicate transaction by its contents and links. In the transport records, we looked for identical trips by one vehicle with one driver on the same date.

Can we immediately delete all the duplicates we find?

Here, we marked duplicates for deletion. Before making a final decision, we check linked documents and payments. We performed no destructive actions without the manager’s decision.

Why did an order remain unpaid after importing the statement?

One cause we found was an incorrect invoice number in the payment description. The money was allocated to another order, leaving that one overpaid and this one underpaid. We resolve such cases by reconciling settlements.

Were the files decrypted after the attack?

No, there is no decryptor. We restored the accounting records from the surviving accounting database, incoming bank payments, and scanned driver reports. Restoring accounting records and decrypting files are separate tasks.

Need help investigating your database?

At IKORG, we help restore documents, find duplicates, check data exchange, and review payment allocations in 1C. The Claude Code AI agent performs the work under the studio owner’s supervision. Changes are logged, a person checks ambiguous cases, and destructive actions require the manager’s decision.

If numbers repeat, changes disappear, or unexplained outstanding balances remain after an import, contact us. Specify the configuration, the missing period, and the surviving sources. We will examine the database’s state and determine what can be restored and what needs further checking.