How to Perform Database Repairs

From TrainzOnline
(Difference between revisions)
Jump to: navigation, search
m (How to Create a "Clean Database")
m (How to Create a "Clean Database")
Line 162: Line 162:
 
<tr valign="top">
 
<tr valign="top">
 
<td>[[file:DotPoint.JPG]]</td>
 
<td>[[file:DotPoint.JPG]]</td>
<td>A '''Clean Database''' will return your TRS19 or TANE install to its original, newly installed, condition</td>
+
<td>A '''Clean Database''' will return your TRS19 or TANE database to its original, newly installed, condition</td>
 
</tr>
 
</tr>
 
</table>
 
</table>

Revision as of 16:24, 26 January 2019

This guide will take you through the process of performing manual database repairs and clean database installs. TRS19 and TANE will automatically perform database repairs when they detect corruption in the Trainz database but sometimes a manual repair or even a manual clean install of the database is required.

Contents

What is the "Trainz Database"?

DotPoint.JPG The Trainz Database contains all the installed assets


In the earliest Trainz versions all the assets that came installed with Trainz, or that you installed from the DLS or downloaded as .cdp files, were stored as separate folders on your designated data drive. This made it easy to access the assets for editing and other operations. However the penalty was that each time you started Trainz it had to scan the assets to check their integrity and the more assets you had the longer the startup took. This led to a great many complaints from users.

Today, all installed Trainz assets are added as records in an asset database which has significantly sped up the startup process and has reduced the possibility of accidental data corruption by users. The penalty is that users can no longer access the installed assets by using Windows Explorer. Access to the assets in the database for editing and examination is through the Content Manager program.

Because it is a database manager, Content Manager also provides users with many more search, display and management options than were ever previously possible. Each entry in the display shown below is a single record in the Trainz database. Each entry can be easily opened for editing, it can be deleted, copied (cloned) and updated. New assets can be manually created or installed from other sources.

DBR EDBR20.png


How to Perform a Database Repair (a DBR)

DotPoint.JPG A DBR performs a "surface scan" of the database detecting missing content and content errors. It will update your database and can clean up some corrupted data.


This is the simplest and (usually) the fastest option.

NotePad.PNG Notes:

Perform a DBR if you have:-

  • unexpected problems with missing content
  • content errors with installed assets (particularly if those assets did not previously show any problems)

A DBR process updates your database, revalidates the content and can often clear up any corruption that has occurred.


DotPoint.JPG If you have installed a new asset that CM reports has having "missing" or "unknown" assets then a DBR is very unlikely to find those missing assets.



Steps.PNG Steps (both TRS19 and TANE):
DBR EDBR01.png DBR EDBR02.png
From either the Launcher (left) or Content Manager (right):-
  1. open the Developer menu
  2. select the Rebuild Database option

The process will proceed automatically and unaided through a number of steps, only some of which are shown below. The time required for each step will vary enormously (some will take much longer than others) and the total time involved will depend on the number of assets installed, the speed of your system and other factors.

1. Scanning for deleted asset files
DBR EDBR03.png

2. Scanning for added asset files
DBR EDBR04.png

3. Importing built in assets
DBR EDBR06.png

4. Rebuilding cached asset data
DBR EDBR07.png

The Rebuilding Trainz Asset Data window will disappear if the DBR process has been successfully completed without finding any errors. If errors have been found then the window will remain on the screen to report on the number of errors and warnings.

How to Perform an Extended Database Repair (an EDBR)

DotPoint.JPG An EDBR performs a "deep scan" of the database and checks that the data in every asset conforms to the rules for that type of asset


This is a more complex, slower and potentially more dangerous repair. An EDBR will detect and flag errors in the data that a DBR will miss. It runs every single asset in the database through the same error and compliance checks that are run when a new asset is installed.

NotePad.PNG Notes:
  • Perform a EDBR if you have serious problems with your data that a DBR does not repair
Stop.PNG It is not unusual for CM to display a list of faulty assets that were not shown as faulty before the EDBR was run



Steps.PNG Steps (both TRS19 and TANE):
DBR EDBR01.png DBR EDBR02.png
From either the Launcher (left) or Content Manager (right):-
  1. open the Developer menu
  2. hold down the Ctrl key
  3. select the Rebuild Database option


A possible result of an EDBR.

DBR EDBR10.png


How to Create a "Clean Database"

DotPoint.JPG A Clean Database will return your TRS19 or TANE database to its original, newly installed, condition


NotePad.PNG Notes:

A "Clean Database" will create a new Trainz database containing only the built in and base assets that came with the original Trainz (TRS19 or TANE) installation. Use this option if you want to remove from your Trainz install all:-

  • DLS assets
  • DLC assets
  • third party assets
  • assets you have created yourself (e.g. routes, sessions, etc) - but make sure that you have the original data files backed up somewhere.

This is usually performed when the Trainz Database contains faulty installed assets that are causing crashes and other problems.

Stop.PNG You will be creating another copy of the database but without any downloaded content. You will need enough space on your selected data drive to hold the data. Your original database will not be deleted until you are ready to delete it

Steps.PNG Step 1: Create a Container
  1. use Windows File Explorer to create a new folder on your data drive (D: if you have one, C: if you don't)
  2. give the folder a meaningful and easy to remember name such as TRS19_Clean_Database


Steps.PNG Step 2: In TRS19 (or TANE) Launcher
  1. click the Trainz Settings button
  2. click the Install tab
  3. write down the location of the Local Data Folder - you may need it again!
  4. click the button [...] next to the local folder display name
  5. browse to your new data folder created in Step 1: Create a Container above
  6. select (click on but do not open) your new data folder
  7. click the button [Select folder]
  8. close any open File Explorer windows

You will see a progress bar as the built in assets are copied across to the new folder.



Steps.PNG Step 3: Restart and Reconfigure
  1. restart TRS19/TANE when you are prompted to do so
  2. open the Trainz Settings again and click the Internet tab
  3. delete and re-enter your username and password
  4. when your username/password have been accepted, restart TRS19/TANE again
  5. open the Trainz Settings again and click the General tab
  6. set any changed options to your preferred settings
  7. click the Performance tab and set any changed options to your preferred settings
  8. exit Trainz Settings and click Start Trainz

You will be prompted to download any DLC assets that you may have previously purchased. You can install them now or defer their install until later.


Your original (and possibly faulty) database is still on your system at the location you recorded in Step 2 above. You may choose to eventually delete it.



Trainz Wiki

TrainzWiki.png

More Tutorials and Guides to Using Trainz

Personal tools