Trainz2010 re-install problem (copied-over User Data corrupts database).

Lataxe

Member
Following a kerfuffle with the PC, it became necessary to reload the Window7 O/S and then all the programs, onto a new C: drive. (I did have a system image and full data backup but there was an issue with the boot sector so that system image wasn't usable in practice).

Anyroadup....all the O/S and programms are now reloaded, including Trainz2010, S&C and all my other Auran purchases. I have performed the patches to 44088 (the latest patch disagrees with my PC, as I know from a past kerfuffle). I have also updated the out-of-date kuids that will update. This all ran succesfully.

So, I come to copying across my User Data file with the many routes and sessions in it that I have downloaded & tweaked - some 20-odd Gb. But I now have problems.....
First, an extended database repair tells me there are 1600+ errors due to the items concerned not being found where expected in the database. The extended repair does not fix this or the consequent problem (see next paragraph).

Presumably as a result of the above database corruption, I now have trouble amending many of my routes and sessions. When I save such routes or sessions, under a new name, I get the message that the route/session has been saved but not committed; but that I can commit it in CMP.

However, when I go to CMP, the route/session is shown as "New Asset" (not the file name I saved it under) in the "open for edit" status; and will not commit due to "an error in the database". No amount of fiddling with it in the CMP Editor helps - it remains stubbornly uncommitable.

I have read the various threads concerning how to reinstall Trainz then copy across the User Data folder from my backup. In fact, I know I've done this successfully in the past (following the destruction of my TRAINZ 2010 build by that latest patch). But not this time.

The weird thing is, TRAINZ will save and run amended routes succesfully if I run the Trainz exe file from that same backup disc (an external disc connected via USB2) from where I copied the User Data folder. So, I tried copying across ALL the TRAINZ stuff from the backup disc, except the ja files, which are identical to those on the C: drive (and very large, of course). Same problem remains concerning the saved-but-cannot-commit issue.

Anyone have a clue about how to fix (or replace) the C: drive TRAINZ database from the backup drive version, where TRAINZ is happily working? I am not sure which file(s) incorporate the database itself.
Perhaps I should just delete the C:drive TS2010 folder and copy over the TS2010 folder en-masse from the backup drive (many, many Gb with all those ja files included)...?

Thanks in anticipation for any advice.
 
I'd just replace the new install with the old, copying the user data folder doesn't work well, better to use the content managers import.
 
Clam & EUphod,

Thanks for the replies and advice. In future I'll employ the Reinstall-then-Import method rather than merely copying over the User Data folder.

At the moment I have the whole TS2010 folder from the backup disk copied over to the data disc (i.e. all the Trainz 2010 programs and data) which is a physically separate disk (D:) from the O/S (C:) disk and from the backup disk (E:). I deleted the Trainz 2010 folder off the C: drive but didn't uninstall Trainz (via the Windows Unistall process) so presumably I have left the Registry entries as required for the Trainz program to run.

And run it does, from the data drive, with no problems at all. I also took a new Windows7 backup which has included the Trainz2010 folder that is now on the data drive.

So, for the moment I'll leave this arrangement, since it appears to work perfectly, in running Trainz sessions, editing routes/sessions and doing things with CMP.

One final question: is it possible to get Trainz2010 to run its programs from the O/S (C:) drive but store all the data (ja & User Data files) on a physically separate disk (the D: data drive)? This is how I arrange all other software but Trainz doesn't seem to give any option to install data to a separate location from the program files....?

Thanks once again for your help.
 
Clam & EUphod,

Thanks for the replies and advice. In future I'll employ the Reinstall-then-Import method rather than merely copying over the User Data folder.

At the moment I have the whole TS2010 folder from the backup disk copied over to the data disc (i.e. all the Trainz 2010 programs and data) which is a physically separate disk D: from the O/S C: disk and from the backup disk E:. I deleted the Trainz 2010 folder off the C: drive but didn't uninstall Trainz (via the Windows Unistall process) so presumably I have left the Registry entries as required for the Trainz program to run.

And run it does, from the data drive, with no problems at all. I also took a new Windows7 backup which has included the Trainz2010 folder that is now on the data drive.

So, for the moment I'll leave this arrangement, since it appears to work perfectly, in running Trainz sessions, editing routes/sessions and doing things with CMP.

One final question: is it possible to get Trainz2010 to run its programs from the O/S C: drive but store all the data (ja & User Data files) on a physically separate disk (the D: data drive)? This is how I arrange all other software but Trainz doesn't seem to give any option to install data to a separate location from the program files....?

Thanks once again for your help.
 
Afraid not possible to split the data from the Trainz folder due to the nature of the database, nothing to stop you putting the whole lot on a different drive, mine are on drives E and G, G being a backup of E, yes I do have a lot of internal drives. Also backed up to another PC just used for keeping backups on.
I don't put any programs on the C drive other than Microsoft ones, which I tend to avoid anyway and just leave it for the OS.

Actually nearly all the registry entries other than maybe file associations are created on first running Trainz so you can copy to a PC that's never had it installed, set up the shortcuts manually and it works.
 
Last edited:
There is a copy of certain Trainz files stored elsewhere (C:/Users/<username>/Appdata/Local/VirtualStore), but be aware that files stored in here cannot be read by Windows programs, hence why assets disappear when running Trainz in non-administrator mode, as the folder is isolated from everything else.

Shane
 
There is a copy of certain Trainz files stored elsewhere (C:/Users/<username>/Appdata/Local/VirtualStore), but be aware that files stored in here cannot be read by Windows programs, hence why assets disappear when running Trainz in non-administrator mode, as the folder is isolated from everything else.

Shane

For some reason when it runs in non admin mode it stores all the assets you install in that directory, and to get them you have to copy the content from that folder to the real local folder in Program Files. That's how I solved my problem with missing assets. Also when I run in non admin mode trainz doesn't remember the settings.

So running trainz as administrator is pretty important
 
Exactly my point. When it's running in non-admin mode, it works by emulation/virtualisation, which means that it cannot write to protected locations.

Trainz expects it's files to be in the same folder.

Shane
 
Thanks all for the further knowledge concerning the ins & outs of Trainz files on disk. One learns a little something every day. :)

Reading this and other threads elsewhere, it seems the best strategy for locating Trainz files might be to dedicate a discreet physical drive to hosting Trainz (and perhaps nothing else).....? This drive might also be an SSD, to speed up the access timings as Trainz loads various files to run a session...?

The reason I asked if it was possible to separate Trainz program and data files on to two separate physical disks was that this strategy works well to speed up other programs that run heavy processing and data access events togther.

Photoshop batch processing is a good example, where one disk is churning out the code to run various complex processes whilst another disk is reading and writing the photo files involved. Separating the Photoshop program and data files on to two physical disks certainly speeds up things for me, in this scenario.

Since we're here, might I ask another question: what is the narrowest bottleneck within a typical PC architecture when running Trainz on a 64bit system? Mine has a 4 core 3.2 Phenom processor, 8Gb of RAM and a Radeon HD 6670 PCI-Express-2.1 card but slow SATA 5400rpm WD disks (3).

It's surprising how well Trainz will run with a few tweaks of obscure settings here and there - in Trainz Options but also on the graphics card. For example, I have a 2560 X 1600 30" screen, as the PC is used for Photoshopping but also watching television. You would think Trainz frame rate would be very poor if set to run at this native 2560 X 1600 screen resolution.

However, not so! A few tweaks here and there and even large routes with a lot of AI trains going will run smoothly enough - no jerkiness although I suspect the frame rate is not quite 30 fps. :) It even copes with maximum draw distance, minimal fog etc..

What does take time (up to 15 seconds to load everything until smooth running is achieved once more) is switching views from one AI driver to another. Presumably this is because Trainz is accessing files (to build the new view) stashed on the HD, to load into memory....? Sometimes the view-switch is near-instant - presumably because the relevant files are still loaded into RAM from a previous "visit" to that area of the map....?
Perhaps one day we will get 64bit Trainz and we can load up that big ECML session entirely into RAM! It is the only session to reduce my Trainz frame rate to the unacceptable.

Thanks once more for all your advice and information.

Lataxe

PS I have another query about the VirtualStore stuff, in a separate post.
 
Can you post a link to the the separate post you are referring to? I have quite a bit of knowledge regarding the VirtualStore folder.

Shane
 
I have made a mess

Despite knowing that Trainz needs to run in Administrator mode, when I last reinstalled it, I forgot to tick the "run as adminstrator" box in the Trainz exe file Properties page. As a consequence I have a couple of days-worth of hash files in the VirtualStore User_data/local folder mentioned by Shane Turner in his post above.

Not knowing about this VirtualStore "cellar" being secretely filled with my route-changing "wine", I later ticked the "run as administrator" box for Trainz.exe and continued to tweak (and also download) the odd route & session.

So now I have some hash files from 13-14/2/20012 in the VirtualStore User_data/local location but also some hash files dated 14-15/2/2012 in the "proper" User_data/local folder - that nested in the same Trainz2010 folder as the program, ja files et al.

Shane seems to be saying I can copy across the VirtualStore User_data/local hash files to the "proper" User_data/local folder within the Trainz2010 folder. Is this safe now that I've subsequently written some hash files into the proper folder? I notice that hash files are duplicated (by name) in these two folders - but the file sizes are different.

Now that I've told Trainz to "run as administrator" will the program still access the VirtualStore hash files to recover data when I open a relevant route or session? If not, will I have lost changes made and written to the VirtualStore before I told Trainz to "run as adminstrator"?

Should I try to identify VirtualStore hash files that do not exist in the Trainz2010 User_data/local folder and just copy across those? (I believe the Windows7 copy process will identify duplicate-name files and ask me if I want to replace with the copied-over version or not, so the process would not be too difficult).

Any further enlightenment about this VirtuaStore revelation will be gratefull recieved.

Lataxe
 
I would advise two steps:

1.Copy/move the files from the relevant subfolder in VirtualStore into a folder on the Desktop.
2.Use Import Content in Content Manager and point it to the newly-created folder.

About the VirtualStore folder


This folder is used as a 'storage' folder for files created by non-administrative processes that were originally directed to a protected folder (any folder that is not user-specific, this means any folder that is not present under C:/Users/<username>).

What this does mean though is that when the process is once again run as administrator, it now can write directly to the protected folder, without needing to use the VirtualStore folder.

Files in the VirtualStore folder can be written to by non-administrator processes, but cannot be read as the program will look in the normal protected folder for the file(s) (reason for this is because the program believes that the file has been written in the protected folder, but in the background Windows has redirected the writing so it is actually writing to a subfolder of the VirtualStore folder).

Hopefully this makes sense.

Shane
 
Reason why Shane is specifying use the import, is because the hash names are not unique to an asset but allocated on an as come basis, probably in order of installing. Thus the duplicate names, which may not be the same items.
 
Fisrt apologies, Shane, for not replying to you direct - our posts crossed in the aether.

With Clam's added bit, I think I now understand that the VirtualStore User_data/local hash files may contain updates I have made before telling Trainz to "run as adminstrator" - but these updates cannot be easily compared to those in the Trainz2010 User_data/local folder as the hash folder numbers do not necessarily map, respectively,to what's inside them.

So, I understand now (I think) that using Trainz Import facility in the CMP will find anything in the VirtualStore hash files not subsequently amended in the hash files of the Trainz2010 User_data/local folder then install/commit it.

But before I go off creating myself another mess, may I ask how to resolve those instances where I created a version of a route/session in the VirtualStore folder but then created a later version of the same route/session in the Trainz2010 folder?

Does the Import dialogue stop the process where there is already an instance of something that the copy could overwrite, allowing me to choose whether to overwrite or not?
Even if it does, how do I detect whether the version to be overwritten is older or younger than the VirtualStore file about to be copied (or not)?

As you will appreciate, I am now rather nervous about the Trainz database and my cack-handed crashing about corrupting it again. :)

Lataxe
 
Hi again Lataxe,

As mentioned in my previous post, it is best to copy the hash folders from the VirtualStore folder into a subfolder of the Desktop (i.e. create a folder first)

In Content Manager's Settings dialog, click Miscellaneous, then Reset Warning Dialogs, then click Yes to confirm, followed by Save.

You can now import the newly copied files - Content Manager will warn if the asset already exists, with the option to overwrite or skip.

Shane
 
Shane,

I've done as you described and everything seems tickety-boo with the CMP and with the amend-then-save process from Surveyor. A fully working Trainz again. Huzzah!

Thanks again for all your help (you in particular but all respondents). I've learnt a wee bit more of Trainz lore; but also about the Windows VirtualStore, other content of which (besides that from Trainz) I am now investigating.
What a useful place this is.

Lataxe
 
Back
Top