PS4 News       Thread starter 73n1x69       11000       12
Status
Not open for further replies.

FFTHEWINNER

Staff Member
Moderator
Contributor
Verified
to backup database:

run the hen payload and then run the ftp payload.

ftp into /system_data/priv/mms/
and copy app.db to your computer.

you can take addcont.db if you like that holds stuff like extra seasons of games.

Note: when you install new games you will need to backup app.db again so it includes those new games too.


to restore broken database:

run the hen payload and then run the ftp payload.

ftp into /system_data/priv/mms/

upload your saved app.db from your computer to that directory overwriting the app.db inside the ps4

power off the ps4 as you normally would then boot it back up and see if it has changed.

this worked for me when I was playing around with that run games from hdd idea, my database rebuilt and I lost all the tiles for 40+ games but I had saved a copy of my app.db and when I tried to put it back with just the ftp payload running it would rebuild again but when I used hen payload and the ftp payload it restored all my tiles and still works now.

if someone wanted to make a payload to back it up they could do something like this

Code:
#include "ps4.h"

int _main(void) {
    initKernel();
    initLibc();
    copyFile("/system_data/priv/mms/app.db", "/system_data/priv/mms/app.backup");
    return 0;
}

void copyFile(char *sourcefile, char* destfile)
{
    FILE *src = fopen(sourcefile, "r");
    FILE *out = fopen(destfile,"w");
    char buffer[60480];
    size_t bytes;
    while (0 < (bytes = fread(buffer, 1, sizeof(buffer), src)))
            fwrite(buffer, 1, bytes, out);
    fclose(src);
    fclose(out);
}
thanks very much for the explanation. i think this should be in the tutorial section of the PS4 forums. it will help lots of people :)
 

stooged

Developer
Senior Member
Contributor
if you want a payload to backup the database to a usb drive here you go: DbBackup.zip

https://pastebin.com/A226z7Nt
Code:
#include "ps4.h"


int _main(void) {
    initKernel();
    initLibc();

        FILE *usbdir = fopen("/mnt/usb0/.dirtest", "wb");
 
         if (!usbdir)
            {
                usbdir = fopen("/mnt/usb1/.dirtest", "wb");
                if (!usbdir)
                {
                           copyFile("/system_data/priv/mms/app.db", "/system_data/priv/mms/app.db_backup");
                        copyFile("/system_data/priv/mms/addcont.db", "/system_data/priv/mms/addcont.db_backup");
                        return 0;
                }
                else
                {
                        fclose(usbdir);
                        unlink("/mnt/usb1/.dirtest");
                        mkdir("/mnt/usb1/DB_Dackup/", 0777);
                    copyFile("/system_data/priv/mms/app.db", "/mnt/usb1/DB_Dackup/app.db");
                    copyFile("/system_data/priv/mms/addcont.db", "/mnt/usb1/DB_Dackup/addcont.db");
                }
            }
            else
            {
                        fclose(usbdir);
                        unlink("/mnt/usb0/.dirtest");
                        mkdir("/mnt/usb0/DB_Dackup/", 0777);
                    copyFile("/system_data/priv/mms/app.db", "/mnt/usb0/DB_Dackup/app.db");
                    copyFile("/system_data/priv/mms/addcont.db", "/mnt/usb0/DB_Dackup/addcont.db");
            }
    return 0;
}

void copyFile(char *sourcefile, char* destfile)
{
    FILE *src = fopen(sourcefile, "r");
    FILE *out = fopen(destfile,"w");
    char buffer[60480];
    size_t bytes;
    while (0 < (bytes = fread(buffer, 1, sizeof(buffer), src)))
            fwrite(buffer, 1, bytes, out);
    fclose(src);
    fclose(out);
}
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 :)
 
Status
Not open for further replies.
Recent Articles
Deadpool 60 FPS Mod PS4 Package (PKG) by Wastelander121
Last week he made available a Dishonored: Definitive Edition 60 FPS Mod PS4 PKG, and today @Wastelander121 returns bringing a Deadpool 60 FPS Mod PS4 PKG (CUSA-03528) via Twitter with a...
Wolfenstein: Cyberpilot & Wolfenstein: Youngblood Join Latest PS4 Games
PlayStation VR fans can expect to see Wolfenstein: Cyberpilot arrive on PS VR while Wolfenstein: Youngblood hits PS4... both on July 26th: :) Wolfenstein: Cyberpilot puts you in the action on...
IG Tools: Insomniac Games Reversing and Modding PS4 Tools
Following recent Spiderman PS4 Decryption and PS4 Remote Play Protocol Reverse-Engineering development comes IG Tools this weekend by doesthisusername, which are a collection of Kaitai Struct /...
FFVII Dreamake: Final Fantasy 7 Remake in Dreams by Sosetsuken5360
Last month we saw a Metal Gear Solid HD Remake playable in Dreams on PS4, and this weekend another noteworthy creation dubbed FFVII Dreamake (a fan-made Final Fantasy 7 Remake) by Sosetsuken5360...
Top