Can you shine any light on what emanuele was referring to by "not set up in a very safe way"?
The general premise of using a file database is that you try to keep it outside of the web root, otherwise people could just download it and be done with it... there are other factors around the safety of files in general where being writable by Apache/PHP are concerned but that's the big one.
Honestly, I have no idea why people would even use SQLite for SMF, it will bottleneck on I/O far before the forum ever gets big enough that uploading will ever be a real problem.
In general, restoring a database from a backup should NOT be performed inside SMF. It really shouldn't, regardless of DB system. It would be quite feasible, though marginally unlikely, for a restoration of a backup to break midway through if, say, the user performing the restoration is a new account and didn't exist in the previous backup since their account (and privileges) will disappear once the members table is restored. This has actually happened in the past.
Yeah, the whole thing around the filename is a bit weird because you can't rely on it having the .db extension though it really should.
Yes, the connection should be closed before restoring, however the template does not actually require the database by definition - all the template stuff happens after main execution has finished and by definition that should include all database stuff. There is one exception of course: session data.
This is the other reason you don't do a restoration from the admin panel, you essentially have to ignore sessions or pray you don't screw it up entirely in the process.