Join Us and become a Member for a Verified Badge on Discord to access private areas with the latest PS4 FPKGs.
PS4 CFW and Hacks       Thread starter PSXHAX       Start date Sep 12, 2018 at 1:44 AM       56,045       162      
Since his PS4Updates.py python script, PlayStation 4 developer Zer0xFF returns with PS4_db_rebuilder which will restore your FPKGs (Fake Packages) after rebuilding the PS4 database. (y)

Download: PS4_db_rebuilder (Latest Release) / GIT / release_0.1.EXTERNAL.zip (v0.1 rebuilder for external only) via thxalot60 / Restore_DB_PS4_2020.rar (30 KB - For 6.72) / PS4_db_rebuilder_6.72-0.2.zip (Python Script with added support for 6.72 FW) / GIT Fork by lKinderBueno

Here's further details from the README.md file, to quote: PS4_db_rebuilder

PS4 built in database rebuilder has the tendency to remove FPKG from the database, this will repopulate the database with them

Requirement
How-to-use
  1. recursively clone this repo or download a Release
  2. start FTP server on the PS4
  3. run the python script though terminal/cmdline python3 fix_db.py PS4_IP (command for external via sp0k: py fix_db.py PS4_IP)
  4. wait for the script to finish, then logout of the PS4 user without closing the browser
  5. log back in and all your games should be there again
:arrow: Update: From the README.md forked by lKinderBueno: PS4_db_rebuilder - Updated to 6.72

PS4 built in database rebuilder has the tendency to remove FPKG from the database, this will repopulate the database with them

requirement
  • Python (preferably 3.0+)
how-to-use
  1. recursively clone this repo or download a Release
  2. start FTP server on the PS4
  3. run the python script though terminal/cmdline python3 fix_db.py PS4_IP
  4. wait for the script to finish, then logout of the PS4 user without closing the browser
  5. log back in and all your games should be there again
Changelog
  • Fixed error "table tbl_appbrowse_XXXXXXX has 53 columns but 47 values were supplied"
  • Support to FW 6.72
PS4_DB_Rebuilder to Restore FPKGs After PS4 Database Rebuilding.jpg
 

Comments

stripnwild

Senior Member
Contributor
Verified
@lukasua I had a similar problem awhile back. I had done a system rebuild because the ps4 was running slow (the article stated it wouldn't affect things - but it did) so of course it wouldn't see any external HD with games on it.

Eventually found this program, ran it but It would stop on certain CUSAxxxxx games, which I realized were games that I had deleted off the EXT HD? I tried everything with no success, so I eventually I decided, as a last ditch effort, to try reinstalling the odd game that the script would stop at (it was about 5 or 6 games)

Once I installed these games to the internal ((Didn't attempt to move them to EXT)) and re-ran the script it WORKED! Not sure this helps you or not but it worked for me. _ THEN I BACKED UP MY DB!
 

lukasua

Member
Contributor
@stripnwild Thank you very much for your answer. I looked at my log of the script in terminal and it seems every pkg shown at the start, launching the script, appear on the completed one. So I don't know if some pkgs are really missing or there is another linked problem.

If I understood well your problem, you could see which pkg was not found because the script stopped on that pkg. Otherwise if I have to guess which pkgs are missing in my HD, I have not enough space on my brain to remember that.
 

stripnwild

Senior Member
Contributor
Verified
in the CMD window when the script was run it would actually stop on cusa00234 as an example... and wouldn't continue...so i would install cusa00234 again.

once i run the script again it would stop on another game like cusa00435 then i would reinstall that game also. was worried at first because i have 435 games installed on that external hd! but i only had to do it to a handful of games
 

Sergi8

Member
Contributor
Verified
To me it keeps saying "invalid syntax" after a line (self, sfo)

Any help? Python 3.7.2 on Win10

Edit: On WIN10 you should run the script with PowerShell, not with CMD (don't know why)
 

Darktears

Member
Contributor
Very nice script, thx a lot, works like a charm, some DLC didn't work (Wildlands Narco Road) after that, but that's no drama.

Did it with python 3.7.2 win10 and cmd shell (as admin)

powershell didn't work for me.
 

alahuakbar

Member
Contributor
Verified
Code:
C:\Users\click\Desktop\release_0.1>py fix_db.py 192.168.254.106:1337
Traceback (most recent call last):
  File "fix_db.py", line 51, in <module>
    ftp.connect(PS4_IP, 1337, timeout=30)
  File "C:\Users\click\AppData\Local\Programs\Python\Python37-32\lib\ftplib.py",
 line 152, in connect
    source_address=self.source_address)
  File "C:\Users\click\AppData\Local\Programs\Python\Python37-32\lib\socket.py",
 line 707, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "C:\Users\click\AppData\Local\Programs\Python\Python37-32\lib\socket.py",
 line 748, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11004] getaddrinfo failed
anybody got the same error?

nvm the first one got a new error
Code:
C:\Users\click\Desktop\release_0.1>py fix_db.py 192.168.254.106
["'CUSA05625'", "'CUSA00002'", "'CUSA05904'", "'CUSA00559'", "'CUSA04841'", "'CU
SA03309'", "'CUSA01200'", "'CUSA01433'", "'CUSA90160'", "'CUSA00038'", "'CUSA002
65'", "'CUSA07214'", "'CUSA00528'", "'CUSA00327'", "'CUSA00368'", "'CUSA02290'",
 "'CUSA01664'", "'CUSA06886'", "'CUSA06534'", "'CUSA01395'", "'CUSA04107'", "'CU
SA03946'", "'CUSA06712'", "'CUSA05297'", "'CUSA09415'", "'CUSA01857'", "'CUSA015
11'", "'CUSA03481'", "'CUSA09016'", "'CUSA01004'", "'CUSA03541'", "'CUSA01439'",
 "'CUSA06014'", "'CUSA03617'", "'CUSA00861'", "'CUSA01116'", "'CUSA08357'", "'CU
SA01154'", "'CUSA05333'", "'CUSA06321'", "'CUSA04295'", "'CUSA08500'", "'CUSA034
50'", "'CUSA09216'", "'CUSA05986'", "'CUSA03448'", "'CUSA03679'", "'CUSA10212'",
 "'CUSA00419'", "'CUSA05597'", "'CUSA00127'", "'CUSA07439'", "'CUSA05220'", "'CU
SA02747'", "'CUSA09564'", "'CUSA02976'"]
Processing table: tbl_appbrowse_0331811194
        Processing GameID: CUSA00002... Completed 40301035520
        Processing GameID: CUSA00038... Traceback (most recent call last):
  File "fix_db.py", line 81, in <module>
    cusa = get_game_info_by_id(GameID)
  File "fix_db.py", line 44, in get_game_info_by_id
    info[GameID].size = ftp.size("/user/app/%s/app.pkg" % GameID)
  File "C:\Users\click\AppData\Local\Programs\Python\Python37-32\lib\ftplib.py",
 line 636, in size
    resp = self.sendcmd('SIZE ' + filename)
  File "C:\Users\click\AppData\Local\Programs\Python\Python37-32\lib\ftplib.py",
 line 273, in sendcmd
    return self.getresp()
  File "C:\Users\click\AppData\Local\Programs\Python\Python37-32\lib\ftplib.py",
 line 246, in getresp
    raise error_perm(resp)
ftplib.error_perm: 550 The file doesn't exist.

C:\Users\click\Desktop\release_0.1>
 

MussSyke

Member
Contributor
When I run the script, I get this error:
Code:
Processing table: tbl_appbrowse_0273516421
 Traceback (most recent call last):
 File "C:\Python34\Scripts\fix_db.py", line 75, in 
 cursor.execute("SELECT T.titleid FROM (%s) T WHERE T.titleid NOT IN (SELECT titleid FROM %s);" % (files_joined, tbl[0]))
 sqlite3.OperationalError: too many terms in compound SELECT
I think this has something to do with SQLite being limited to 500 objects. I had installed more than 1000 games blissfully unaware that my DB could become corrupted in this way. I can't imagine installing them all again, but it was quite nice to have it setup that way.

From reading a bit about SQLite, it seems there is a workaround, but I'm not sure how to do it. Anyone have any ideas?
 

thxalot60

Developer
Member
Contributor
Verified
If anyone wants to restore DB for external files I did a very quick and dirty modification to the script to restore external drive DB.

I can provide this to Zer0xFF or others if he is at all interested in updating the pathing for his scripts to include external storage. The downside is that I have not figured out how to restore addcont.db.
 

hernani

Member
Contributor
It has not worked 100%, in my case my ps2 games (FPKG) were not visualized and the games that did recover take up more space than before.
 

:fire: Latest Help Topics

Top