How to restore a backup copy of model files


Applies To   
Product(s): WaterGEMS, WaterCAD, HAMMER, SewerGEMS, SewerCAD, StormCAD, CivilStorm, FlowMaster, CulvertMaster
Version(s): 08.11.xx.xx and higher
Area:  Output and Reporting

 

Problem

Can I restore a backup of my hydraulic model? Is there a way to recover model files?

Solution

The solution will depend on the circumstances you are encountering. Here are some possible solutions:

Restoring Backup Files

A .BAK file is a backup file, providing some insurance in case an unexpected issue or corruption occurs with the model. For example if you have a WaterGEMS model you might have a backup file for the .WTG, .WTG.SQLITE, and .WTG.DWH. These would be .WTG.BAK, .WTG.SQLITE.BAK, and .WTG.DWH.BAK. There are also backup files for special XML files for settings such as predefined Flextables, shared queries, etc. One example is SharedQueries.bak, which is located in the user profile (for example for WaterGEMS 2024: C:\Users\<username>\AppData\Local\Bentley\WaterGEMS\24

Also, note that backup files might have a number associated with them if there are more than one .BAK file. For example, .WTG.01.BAK. Whenever a file is saved, the previous version is retained, in the form of these .BAK files. If you need to recover the version of your model before you last saved it, you can copy the model files to a new folder and remove the ".01.bak" extensions. You will need to alter at least the starter files (.WTG, .STSW, etc.) and the database files (.WTG.SQLITE, .STSW.MDB). Once completed, you can normally open the file.

Note that you can control the number of backup "levels". Basically by default, one backup level is used, which is why you see .01.bak files. If you chose to have two backup levels, the previous two revisions of the model will be retained, with .01.bak and .02.bak extensions. To configure the number of backup revisions, go to the Tools menu, click Options, click the Global tab and modify the "Backup Levels" field.

Restoring from the Windows Temp Folder

If the program was unexpectedly interrupted (for example power failure, crash, etc.) and the file was not saved, you should still have the 'main' model files (.STSW and .STSW.SQLITE for current versions of the storm and sewer products; .WTG and .WTG.SQLITE for current versions of water products), which should reflect the last saved version. In this situation, if you are looking to try to restore the model you were working on when the interruption occurred, you may be able to find it in the Windows temporary folder.

Basically whenever you open a model file, the main files are copied to a location within Windows's temporary folder. When you are working on the model, the changes are being written to that temporary copy. When you save it, those changes are only committed to the model folder, or the location where the model is stored. The files are moved from the temporary location and overwrite the old copy in the location where you stored the model.

If the program is not closed properly, the copy of the model may be left behind in the temporary folder. The location of this folder depends on your operating system and Windows user, but a shortcut would be to type in '%temp%' in the Windows Explorer address bar. This will bring you to the main temporary folder. Within this, navigate to \Bentley\PROGRAM_NAME\ (where "PROGRAM_NAME" is the name of the program you're using, such as StormCAD or WaterGEMS). You may want to sort the contents of this folder by date modified, then look for the name of your model file. Try copying the model files ending with .$$$ to another folder on a local drive. Then remove the .$$$ extension and try to open the model.

OpenRoads Designer

With OpenRoads Designer (ORD), an OpenFlows hydraulic model is stored inside the DGN and contains the "Drainage and Utilities" (DU) information. When the DGN is opened, a working copy of the hydraulic model database is stored in the Windows temporary folder, where you can attempt to retrieve it (and re-add to a DGN if needed) in the event that data is lost.

C:\Users\<username>\AppData\Local\Temp\Bentley\SUDA

Locate the files that end with ".stsw.$$$" and ".stsw.sqlite.$$$"; remove the ".$$$" and import into a clean file.