How to repair the database files: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
 
(3 intermediate revisions by 3 users not shown)
Line 14: Line 14:


===Easy way===
===Easy way===
*Download [http://updatesa.mtasa.com/sa/files/sqlite/mtasa-db-repair-win.zip this]
*Download [https://mirror-cdn.multitheftauto.com/files/mtasa-db-repair-win.zip this]
*Unzip and put the files into ''server/mods/deathmatch/''
*Unzip and put the files into ''server/mods/deathmatch/''
*Double click on ''sqlite_repair_internal_db.bat'' to repair internal.db
*Double click on ''sqlite_repair_internal_db.bat'' to repair internal.db
Line 21: Line 21:
===Hard way===
===Hard way===


*Download sqlite-shell-win32 from [http://www.sqlite.org/sqlite-shell-win32-x86-3070700.zip here]. If that link fails, the main download page is [http://www.sqlite.org/download.html here].
*Download sqlite-tools-win32 from [https://www.sqlite.org/2022/sqlite-tools-win32-x86-3400000.zip here]. If that link fails, the main download page is [https://www.sqlite.org/download.html here].
*Unzip and put sqlite3.exe into ''server/mods/deathmatch/''
*Unzip and put sqlite3.exe into ''server/mods/deathmatch/''
*Open command prompt the change directory to ''server/mods/deathmatch/''
*Open command prompt the change directory to ''server/mods/deathmatch/''
Line 39: Line 39:
===Only way===
===Only way===
(You can use the easy way by copying the DB from linux to windows, and use the method used on windows PC's)
(You can use the easy way by copying the DB from linux to windows, and use the method used on windows PC's)
*Download sqlite-shell-linux from [http://www.sqlite.org/sqlite-shell-linux-x86-3070700.zip here]. If that link fails, the main download page is [http://www.sqlite.org/download.html here].
*Download sqlite-tools-linux-x86 from [https://www.sqlite.org/2022/sqlite-tools-linux-x86-3400000.zip here]. If that link fails, the main download page is [https://www.sqlite.org/download.html here].
*Unzip and put sqlite3 into ''server/mods/deathmatch/''
*Unzip and put sqlite3 into ''server/mods/deathmatch/''
*To repair internal.db:
*To repair internal.db:
Line 45: Line 45:
**Do this command: '''./sqlite3 internal_original.db .dump | ./sqlite3 internal_repaired.db'''
**Do this command: '''./sqlite3 internal_original.db .dump | ./sqlite3 internal_repaired.db'''
**Copy '''internal_repaired.db''' to '''internal.db'''
**Copy '''internal_repaired.db''' to '''internal.db'''
<section name="Commands" class="server" show="false">
<syntaxhighlight lang="lua">
cp internal.db internal_original.db
./sqlite3 internal_original.db .dump | ./sqlite3 internal_repaired.db
cp internal_repaired.db internal.db
</syntaxhighlight>
</section>


*To repair registry.db:
*To repair registry.db:
Line 50: Line 57:
**Do this command: '''./sqlite3 registry_original.db .dump | ./sqlite3 registry_repaired.db'''
**Do this command: '''./sqlite3 registry_original.db .dump | ./sqlite3 registry_repaired.db'''
**Copy '''registry_repaired.db''' to '''registry.db'''
**Copy '''registry_repaired.db''' to '''registry.db'''
<section name="Commands" class="server" show="false">
<syntaxhighlight lang="lua">
cp registry.db registry_original.db
./sqlite3 registry_original.db .dump | ./sqlite3 registry_repaired.db
cp registry_repaired.db registry.db
</syntaxhighlight>
</section>


[[Category: Support]]
[[ru:How to repair the database files]]
[[ru:How to repair the database files]]

Latest revision as of 22:22, 24 December 2022

You might be OK

There might be nothing to worry about. Check these points:

  • Did you come to this page because of a message you saw in the server console or logs?
  • Is the following text at the start of the error message block?
   ERROR: near "3": syntax error
  • If so, then everything is OK. You don't have to do anything written below and you can safely ignore the error message.

Warnings

Backup all files before attempting a repair!
Shutdown the server before attempting a repair!

Windows server

Easy way

  • Download this
  • Unzip and put the files into server/mods/deathmatch/
  • Double click on sqlite_repair_internal_db.bat to repair internal.db
  • Double click on sqlite_repair_registry_db.bat to repair registry.db

Hard way

  • Download sqlite-tools-win32 from here. If that link fails, the main download page is here.
  • Unzip and put sqlite3.exe into server/mods/deathmatch/
  • Open command prompt the change directory to server/mods/deathmatch/
  • To repair internal.db:
    • Copy internal.db to internal_original.db
    • Do this command: sqlite3.exe internal_original.db .dump | sqlite3.exe internal_repaired.db
    • Copy internal_repaired.db to internal.db
  • To repair registry.db:
    • Copy registry.db to registry_original.db
    • Do this command: sqlite3.exe registry_original.db .dump | sqlite3.exe registry_repaired.db
    • Copy registry_repaired.db to registry.db


Linux server

Only way

(You can use the easy way by copying the DB from linux to windows, and use the method used on windows PC's)

  • Download sqlite-tools-linux-x86 from here. If that link fails, the main download page is here.
  • Unzip and put sqlite3 into server/mods/deathmatch/
  • To repair internal.db:
    • Copy internal.db to internal_original.db
    • Do this command: ./sqlite3 internal_original.db .dump | ./sqlite3 internal_repaired.db
    • Copy internal_repaired.db to internal.db
Click to expand [+]
Commands
  • To repair registry.db:
    • Copy registry.db to registry_original.db
    • Do this command: ./sqlite3 registry_original.db .dump | ./sqlite3 registry_repaired.db
    • Copy registry_repaired.db to registry.db
Click to expand [+]
Commands