Manual 2 · Chapter 11
Database and backup
KoonScan keeps its own data (users, work in progress, log) in its own database: by default one database file per company in C:\KoonScan\data (for example KScan.db), or, if you chose that, in SQL Server Express (instance KSCAN). Never in the SAP database, and not on the SQL Server of SAP either: that licence covers SAP itself only.
Backup: happens by itself#
- Every night at 02:30 KoonScan makes a backup: one file per weekday, so always the last seven days.
- Database file:
KScan_ma.dbtoKScan_zo.dbinC:\KoonScan\data\backup. KoonScan keeps working while the copy is made. - SQL Server Express:
KScan_ma.baktoKScan_zo.bakinC:\Program Files\Microsoft SQL Server\MSSQL17.KSCAN\MSSQL\Backup. - Ask your IT supplier to include that folder in the normal backup. Also keep
C:\KoonScan\appsettings.Local.jsonand the folderC:\KoonScan\certin a safe place. - To make a copy yourself: Administration → Server → Maintenance → Back up now.
- KoonScan also cleans up old, finished work by itself (after 365 days by default, see Maintenance). Open or failed work always stays.
Restoring a backup (database file)#
Only if the database file is damaged or lost. Everything since the backup (work, new users) is lost. On the server, Terminal (Admin):
- Stop KoonScan:
Stop-Service KScan. The scanners show that KoonScan cannot be reached. - Open
C:\KoonScan\datain Explorer. RenameKScan.dbtoKScan-damaged.db. Are there also filesKScan.db-walandKScan.db-shm? Delete them. - Copy the backup of the day you want from
C:\KoonScan\data\backup(for exampleKScan_di.db) toC:\KoonScan\dataand rename it toKScan.db. - Start KoonScan:
Start-Service KScan. - Sign in and check that your users and work are there.
Maintenance: size and cleaning up#
Administration → Server → Maintenance shows the state of the database:
- Database size: how big KoonScan's database is. With SQL Server Express there is a limit per database (50 GB with SQL Server 2025 Express, which the installer sets up; 10 GB with older versions); near the limit, Administration shows the message "The database is nearly full".
- Retention period: how long finished work (posted or closed), the log and signed-out devices are kept; every night KoonScan cleans up what is older. Tap Change to choose 30 to 3650 days, or Never clean up. Open and failed work, users and settings always stay; what was posted is in SAP anyway.
- Clean up now: cleans up straight away instead of tonight. The message says how much ("Cleaned up: … finished tasks, … log lines, … devices").
- Backup, Folder and Last backup: see above. Back up now makes an extra copy.
Moving the database to KSCAN#
Only needed if Administration shows the message that the database is on another SQL Server than KSCAN (for example the SQL Server of SAP). For this you need SQL Server Management Studio (free from Microsoft). If in doubt, let your IT supplier do it.
- Make sure SQL Server Express with the instance KSCAN is on the server. The installer only offers it with a new installation; afterwards you install it yourself (appendix B).
- Administration → Server → Maintenance → Back up now. Remember the file name from the message (for example …\KScan_di.bak).
- Copy that file to
C:\Program Files\Microsoft SQL Server\MSSQL17.KSCAN\MSSQL\Backup. - Open SQL Server Management Studio and connect to localhost\KSCAN (Windows authentication).
- Right-click Databases → Restore Database… → Device → choose the file. Leave the name KScan as it is.
- On the left, go to Files and tick Relocate all files to folder. Click OK.
- Administration → Server → Set up again and confirm. Then, on the server, open Start menu → KoonScan → KoonScan setup: the wizard opens with the setup code filled in. For Database, choose SQL Server, localhost\KSCAN, Windows authentication and the same name (KScan): it says "already exists; KoonScan updates it". Carry on until Save and start.
- Check that your users and work are still there. If everything is fine, have the old database on the SAP SQL Server removed.

