Repairing an SQLite3 configuration database for Access Server is a rare but occasionally necessary task. If you encounter an error indicating a malformed database, such as DatabaseError: database disk image is malformed, this topic will help you diagnose the issue and attempt a recovery.
Ensure your server is stable and the hardware is functioning properly.
Run diagnostics to check memory, disk health, and available disk space.
Connect to your Access Server console and get root privileges.
Halt the Access Server service to prevent further changes:
systemctl stop openvpnas
Back up your database files before attempting any repairs:
cd /usr/local/openvpn_as/etc/db/
mkdir backup
cp *.db ./backup
Now, you have files in the backup subfolder if needed.
Use SQLite3 to convert the damaged database into SQL commands and rebuild it.
Attempt recovery on each of the four main database files.