Skip to content
Maintenance & updates

Year-end backup for shops: which generation to keep

Year-end backup for online shops: why the December 31 copy should outlast the rolling scheme, what belongs in it and how storage, testing and deletion work.

16 min read Backup-ServiceDatensicherungJahreswechselWiederherstellung

In short and in plain language

A shop is backed up every night. Each new backup slowly takes the place of an old one. After a few months the oldest backup is gone.

Some damage is only found after many months. By then the error is in every backup. That is why one extra backup at the end of the year helps. It is not replaced.

This backup must hold everything. That means the data, the pictures, the bills and the settings. It is kept in a different place. A key protects it.

In January you check that the backup can be put back. Only then is it worth something. After a set time it is deleted.

In late November, everything in an online shop revolves around Black Friday, Cyber Monday and the last parcels before Christmas. The backup runs in the background every night and, by design, replaces its oldest copy. That becomes a problem when damage goes unnoticed for a long time: an injected script, a price list that is corrupted bit by bit, a deleted category that is only needed again next season. If something like that surfaces months later, every copy still on hand may already contain the error. For this case the BSI, Germany's Federal Office for Information Security, recommends additional quarterly or annual backups (BSI implementation notes CON.3). This article shows why the state of December 31 deserves its own generation, what belongs in it, how it is stored separately, encrypted and tested, and how it fits with retention and deletion duties. It assumes the basics of a backup scheme with RPO, RTO and the 3-2-1 rule; those are covered in Backup Strategies for Online Shops.

Key takeaways

  • If a loss or an integrity violation may only be noticed very late, the BSI recommends additional quarterly or annual backups (BSI implementation notes CON.3). Otherwise a rolling scheme has no copy left from before the damage.
  • A generation scheme has two parameters: the minimum age of the oldest generation and the number of generations (BSI implementation notes CON.3). The year-end backup raises the minimum age without lengthening the scheme.
  • If the complete data set has to be backed up at a closing date such as year end, only a full backup will do according to the BSI (BSI implementation notes CON.3): database, media, document files and configuration in one copy that needs no older backups.
  • The year-end backup is stored in a separate location, outside any rotation and without write access from the shop server. It is encrypted, and the key is protected by a separate backup (BSI IT-Grundschutz).
  • Only the restore test in January makes the copy usable: recompute the checksums, load it into a separate environment without outgoing mail, and spot-check orders and invoices from December 31.
  • A backup is not an archive: books and annual financial statements must be kept for ten years, accounting vouchers for eight (§ 147 AO), usually in the accounting archive. The year-end backup gets its own justified retention period and a deletion date.

Why the rolling scheme falls short

Typical shop backups work on a rolling basis: a new daily copy replaces the oldest daily copy, a new weekly copy the oldest weekly one, a new monthly copy the oldest monthly one. For shops on our servers we keep 7 daily, 4 weekly and 6 monthly copies (Backup Service description). That covers the common cases well, such as a failed plugin update on a Tuesday evening or an item that was deleted by mistake and is missed two days later. But the oldest copy in such a scheme is at most half a year old.

Damage that started, say, eight months ago is therefore contained in every copy that exists. The BSI describes exactly this mechanism: if a file loses its integrity, for example through malware, this is likely to be noticed not immediately but only after a delay, and the file can then only be restored from a generation created before the integrity loss (BSI implementation notes CON.3). The same applies to deleted files: they are missing from all later backups, and if no older generation exists, the file has to be recreated (BSI implementation notes CON.3).

Shops have typical candidates for this. An injected script in checkout that only surfaces during a review by the payment provider. An extension that overwrites a few properties on every run without anyone noticing. An import that empties the product texts of a rarely visited language. A cleanup of unused media that removes pictures of seasonal items which only go back online next spring. All of these cases have one thing in common: the damage has long been there, and it only becomes visible when someone needs the data. How to spot injected scripts earlier is covered in the articles on malware scanning and cleanup and on protection against web skimming at checkout; the year-end backup is the fallback for when noticing comes too late.

Add, don't extend

More monthly copies only move the problem. Twelve instead of six monthly copies double the storage needed for the monthly tier and still do not cover damage that began thirteen months ago. The year-end backup is a single additional copy with its own retention period, not an expansion of the scheme.

The generation principle according to the BSI

The BSI calls a full backup a generation and advises defining how many generations to keep and how far apart they must be (BSI implementation notes CON.3). A generation scheme can be characterized by two values: the minimum age of the oldest generation and the number of available generations (BSI implementation notes CON.3). The higher the minimum age, the more likely it is that a predecessor version still exists for a damaged or deleted file. The more generations, the more recent that predecessor version is.

As an example, the BSI describes a daily full backup in which the last seven backups are kept, plus the Friday evening backups of the last two months (BSI implementation notes CON.3). So the minimum age of the oldest generation there is about two months. How high it needs to be for your own shop depends on how late damage may be noticed. For exactly this case the BSI lists additional quarterly or annual backups (BSI implementation notes CON.3). Cost sets the limit: the higher the data volume, the more expensive each generation, and a high volume can restrict the number of generations for economic reasons (BSI implementation notes CON.3).

Parameter (BSI implementation notes CON.3)What it doesWhat it means for a shop
Number of generationsThe more generations, the more recent the predecessor versionDaily and weekly copies: a short way back after an update or an operating error
Minimum age of the oldest generationThe higher it is, the likelier a copy from before the damage still existsMonthly and year-end backup: a way back after manipulation or deletion noticed late
Data volumeThe higher it is, the more expensive each generationLarge media libraries call for few, deliberately chosen long-term copies

The BSI explicitly names one constraint: the time between generations must not drop below a minimum. If an automated run keeps aborting and restarting, all generations can be overwritten one after another. The BSI therefore recommends checking the minimum age of a generation before overwriting it (BSI implementation notes CON.3). For the year-end backup this goes further: it does not belong in the rotation at all, but in a storage area of its own that no rotation run can reach.

December 31 as a backup date of its own

Why the turn of the year? First, it is a closing date. If there are points at which the complete data set has to be backed up, for example after weekly, monthly or annual accounting closings, the BSI says that only a full backup will do at these points (BSI implementation notes CON.3). Second, many periods start at year end: under the German Fiscal Code, the retention period begins at the end of the calendar year in which, for instance, the accounting voucher was created (§ 147 AO).

Third, the copy is actually needed in the months that follow. Corporations prepare their annual financial statements within the first three months of the financial year (§ 264 HGB), and small corporations may take up to six months if this is in line with proper business practice (§ 264 HGB). If a difference between orders in the shop and entries in financial accounting shows up during that time, for example because of a faulty export, the shop state of December 31 helps reconcile it. It does not replace the stocktaking: the inventory for the end of the financial year (§ 240 HGB) is a separate listing of assets, and the stock level in the shop is at most a pointer. Where the financial year differs from the calendar year, a year-end backup also belongs on the closing date.

In practice, the first complete run after midnight in the night to January 1 works well. It contains all orders of the old year, and anything that comes in afterwards can be identified by its order date. It is important to record the start time of the run and to know which time zone the database and the backup server use for their timestamps. Otherwise the log says 11 p.m. when midnight was meant, and an hour is missing in the reconciliation. Other date traps at the turn of the year are covered in the article on week 53 and date errors in shops.

What belongs in the year-end backup

A year-end backup must be restorable on its own, without older backups. That is the core of the BSI's term generation: it means a full backup (BSI implementation notes CON.3). Anyone who backs up files incrementally every day therefore needs a standalone full copy of the files at the turn of the year. A chain of increments whose base copy is rotated away later is worthless as a year-end state. The scope has six parts:

Database

A complete, consistent dump with all tables: orders, customers, products, prices, rules and the settings of the administration.

Media

Product images, videos and generally accessible files live in the public filesystem, which in Shopware defaults to the public/ directory (Shopware documentation).

Document files

Invoices, delivery notes and downloadable product files live in the private filesystem, which in Shopware defaults to the files/ directory (Shopware documentation).

Configuration

The environment file with the credentials for database and mail server, plus web server and PHP settings, cron jobs and the message queue configuration.

Custom extensions

Your own plugins and themes plus the dependency lock file, so that exactly this version state can be installed again and not today's.

Restore instructions

Order, commands, versions and responsibilities, printed as well. If they only exist digitally, they can be lost along with everything else in a major incident such as ransomware (BSI IT-Grundschutz).

For the database, a consistent state is what counts. With the option --single-transaction, mysqldump sets the isolation level to REPEATABLE READ and dumps the consistent state of InnoDB tables at the start of the transaction without blocking applications (MySQL Reference Manual). The shop can keep running while the year-end copy is being created. The promise only applies to InnoDB tables, though; tables of other storage engines may still change during the dump (MySQL Reference Manual). The following example shows the building blocks of a run; paths and the database name need to be adapted:

Year-end backup in the night to January 1 (example)
# Record the start time including the time zone
STAMP=$(date +%Y-%m-%dT%H%M%S%z)

# Database: consistent dump without locking the InnoDB tables
mysqldump --single-transaction --routines --events --triggers \
  --default-character-set=utf8mb4 shopdb | gzip > db-$STAMP.sql.gz

# Files: media, private filesystem, custom extensions, configuration
tar -czf files-$STAMP.tar.gz public/media public/thumbnail files custom \
  .env.local composer.json composer.lock

# Checksums for comparison at the storage location and during the test
sha256sum db-$STAMP.sql.gz files-$STAMP.tar.gz > checksums-$STAMP.txt

Caches, compiled theme files and temporary working files do not need to be included. According to the documentation, theme files, plugin assets and sitemaps inherit the setting of the public filesystem, while temporary working files are stored under var/ by default (Shopware documentation). Data that can be rebuilt from the source state can, according to the BSI, be factored in as a further pseudo-generation (BSI implementation notes CON.3). That saves space, but it requires the restore test to include the rebuild.

Store separately, protect against overwriting

Storage media for backups must be kept physically separate from the IT systems they back up (BSI IT-Grundschutz). A folder on the same server is therefore not enough for a year-end backup, and neither is a second disk in the same chassis. If the server fails or is compromised, the year-end copy would be affected as well.

Protection against overwriting matters just as much. The BSI requires ensuring that backups cannot be overwritten, whether deliberately or by accident (BSI IT-Grundschutz). One reason is ransomware: many variants look for network drives with write access and encrypt the data there as well (BSI IT-Grundschutz). Storage media that need special protection should therefore only be connected to the network or the source system during backup and restore (BSI IT-Grundschutz).

In practice this means for the year-end copy: the backup server pulls the files or pushes them into a storage area that the shop server cannot write to, and where no deletion rule of the rotation applies. Anyone using storage with a write lock for a fixed period has to keep deletion duties in mind. If deletion periods must be met, storage media that cannot be deleted, or only with great effort, should be avoided (BSI implementation notes CON.3). So the lock period must not run longer than the planned retention. What the rest of the chain with copies in several locations looks like is covered in the article on backup strategies and does not need to be rederived here.

Encryption that still opens in years

A year-end copy contains customer names, addresses, order histories and, in the configuration, credentials as well. The BSI recommends encrypting all backups and making sure the encrypted data can still be restored after a long time (BSI IT-Grundschutz). The GDPR explicitly lists the encryption of personal data as a measure for the security of processing (Art. 32 GDPR).

With a year-end backup, the second part is the tricky one. A copy that is only needed in one or two years is only useful if the key, the tool and the procedure still exist then. Cryptographic keys in use should be protected by a separate backup (BSI IT-Grundschutz). The BSI also describes the opposite case: if the decryption key is affected by a data loss as well, the data cannot be restored (BSI IT-Grundschutz).

Key, tool, version

A year-end backup needs a short note: which tool and which version were used for encryption, where the key is kept and who may release it. The key is neither stored next to the backup nor only in the head of a single person. If it is lost, the backup is as worthless as if it did not exist. If you want to check whether a service provider follows these rules, the contractual side is covered in the article on GDPR-compliant backup retention.

The restore test for the year-end copy

Backing up data regularly does not automatically ensure that it can be restored without problems (BSI IT-Grundschutz). That is why it must be tested regularly whether backed-up data can be restored correctly and within a reasonable time (BSI IT-Grundschutz). The GDPR requires a process for regularly testing, assessing and evaluating the effectiveness of technical and organizational measures (Art. 32 GDPR). Among these measures it lists the ability to restore the availability of personal data in a timely manner after a physical or technical incident (Art. 32 GDPR).

For the year-end backup, January is the obvious time for the test, while the copy is fresh and a backup error can still be corrected. A procedure in five steps:

  1. Checksums: recompute them at the storage location and compare them with the note from backup day.
  2. Decrypt with the stored key, done by a second person following the written instructions.
  3. Load database and files into a separate environment without outgoing mail and without a connection to payment providers.
  4. Spot-check: last orders from December 31, invoice PDFs from the private filesystem, images of older products, login to the administration.
  5. Document: enter result, duration and deviations in the backup concept. Only then does the copy count as the year-end backup.

The separate environment without outgoing mail is not a detail: otherwise a restored copy may send order confirmations, payment reminders or newsletters to real customers. How a complete restore works in an emergency and how to measure the actual recovery time is described in Disaster Recovery: Restoring Your Shop After an Incident. The test of the ongoing backup, by contrast, belongs before the start of the change freeze for the holiday season, see Change freeze in the maintenance plan.

Year-end backup, archive and deletion duties

The year-end backup is not an archive. If retention periods have to be met, the data should be archived (BSI implementation notes CON.3), that is, kept in a system built for long-term retention, readability and controlled access. Books, inventories and annual financial statements must be kept for ten years, accounting vouchers for eight years and other tax-relevant documents for six years (§ 147 AO). Commercial law sets the same periods for commercial books, accounting vouchers and business letters (§ 257 HGB), and invoices must be kept for eight years (§ 14b UStG). These duties apply to the documents, which usually sit in accounting and the invoice archive, not to the shop backup.

For personal data, the principle of storage limitation applies: it may only be kept in a form that permits identification for as long as necessary for the purposes of processing (Art. 5 GDPR). The purpose of the year-end backup is recovery after damage that was noticed late. That implies a limited period, not storage without end. An obvious approach: the year-end backup stays at least until the following year's backup has passed its restore test, and is then deleted on the set date, including all copies. How long exactly belongs, with reasons, in the backup concept.

FeatureYear-end backupArchive (§ 147 AO)
PurposeRestore the shop after damage noticed lateKeep documents readable for the statutory period
ContentDatabase, media, document files and configuration as a full backupInvoices, accounting vouchers, business letters as individual documents
PeriodIts own justified period in the backup conceptTen, eight or six years depending on the document
EndDeletion on the set date, including all copiesAfter the period expires, provided no assessment period is still running
AccessFew authorized people, for restoresAccounting, tax advisors, tax audits

If deletion periods have to be met, the process and the technology must be set up so that the data can be deleted at the specified times (BSI implementation notes CON.3). How customer deletion requests fit with existing backups, and why a restored backup needs the deletion applied again, is covered in detail in GDPR-Compliant Data Backup and Retention for Shops. If you are closing a shop for good, the periods for data and domain are in the article Closing an Online Shop: What Must Remain After the Last Sale.

Timeline up to the turn of the year

Between the publication of this article and the turn of the year there are just over five weeks, right in the middle of Black Week and the Christmas business. The year-end backup barely touches the running shop, but it belongs in the maintenance plan as a fixed date:

  • By early December: read up on the scheme, storage location and responsibilities in the backup concept and name the gap: which copy is the oldest on December 31?
  • By mid-December: set up a storage area without rotation and without write access from the shop server, prepare the key and the note, do a test run with the current state.
  • Night to January 1: start a complete run or copy the regular full backup out of the rotation, note the start time and time zone, create checksums.
  • First week of January: check the storage, recompute the checksums at the destination, record the deletion date of the new year-end backup.
  • In January: restore test in a separate environment, document the result, delete the older year-end backup as planned.

If you do not want to handle the New Year's Eve step manually, set it up as a separate job in the backup system that runs once a year and reports its result. The BSI advises informing selected people automatically about the backup result and any error messages (BSI implementation notes CON.3). In January, a run without a report cannot be told apart from a run that did not take place at all.

What we make of this in maintenance

With the Backup Service we back up shops on our servers daily to storage separate from the web server at two locations in the EU and keep 7 daily, 4 weekly and 6 monthly copies (Backup Service description). A year-end backup that stays longer than the oldest monthly copy is a deviating requirement; we discuss such requirements in the quote. There we set out when the year-end copy is created, where it is stored and how long it stays; like any other copy, it is restored on request.

The SLA maintenance contract includes backup monitoring with alerts for failed backup runs, so a gap does not only show up during the test. In the Backup Service, an initial inventory determines which data and directories go into the backup (Backup Service description). For Shopware shops, for example under Shopware maintenance, the private filesystem with the invoice PDFs and the custom extensions should be listed there explicitly for a year-end backup. If you first want to know what your current backup covers, start with an assessment via the Backup Service.

Sources

This article is based on data from: BSI, implementation notes for module CON.3 Data Backup Concept (bsi.bund.de); BSI IT-Grundschutz Compendium, module CON.3 Data Backup Concept, 2023 edition (bsi.bund.de); German Fiscal Code § 147, German Commercial Code §§ 240, 257 and 264, German VAT Act § 14b (gesetze-im-internet.de); General Data Protection Regulation, Art. 5 and Art. 32 (eur-lex.europa.eu); MySQL 8.4 Reference Manual, mysqldump (dev.mysql.com); Shopware documentation, Filesystem (developer.shopware.com); Backup Service description (shop-wartung.de). All sources accessed on November 4, 2026.

Related Articles

Maintenance & updates

Week 53 and Year End: Avoiding Date Errors in Your Shop

January 1, 2027 still falls in week 53 of 2026. How to check week formats, time zones, number ranges, holidays and promotions in your shop before New Year.

22 min read
Maintenance & updates

Backup Strategies for Online Shops: RPO and RTO

Backup strategies for online shops: plan RPO and RTO, full and incremental backups, off-site storage and restore testing for disaster recovery.

12 min read
Maintenance & updates

Cleaning Up Unused Shop Media: Storage and Backups

Shopware removes unused media with media:delete-unused. How the dry run, grace period and backups fit together, and which images the cleanup run misses.

19 min read