@stooged lent a hand sharing both details with source code on Backing Up and Restoring the PS4 Database, and he followed up with a handy DbBackup.bin Payload compiled for PS4 4.05 OFW users to backup their PlayStation 4 database to a USB Drive alongside one for dumping save data below.
Download: DbBackup.zip / Source Code / DB_SG_Backup.zip (8.79 KB - dumps save data into a folder called GameSaves) / DB_SG_Backup_v2.zip (8.27 KB - Dumps All User Accounts) / DB_SG_Backup3.zip (8.82 KB - Adds Notification Messages from 2much4u)
To quote from his recent post with usage instructions:
just put a usb stick/drive into the usb port and run the DbBackup.bin payload
it will save the addcont.db and app.db files inside a folder called DB_Dackup on the usb drive.
if you do not use a usb stick/drive it will backup the database into the /system_data/priv/mms/ folder on the ps4 and it will be called app.db_backup.
to restore the db just ftp into the /system_data/priv/mms/ directory and upload your backup copy.
credit to @XVortex for the neat way to check which usb port has the drive in it in their ps4dumper source, I tried a few other things with no decent result but @XVortex had a simple method to do the trick