You are currently reviewing an older revision of this page.
It goes without saying that backing up critical data is always a good practice. promis.e and Bentley Substation data can be protected by creating project backups on demand and by copying the data folder or critical parts of it (catalogs, parts databases, etc.) to a safe place periodically.The techniques described by this document are ways to backup the project folders and the SQL project database outside of promis.e and Bentley Substation (referred to as "the software" for the remainder of this article). If the project folders and the database are backed up at the same time, they both can be restored with no loss of synchronization (no errors). This approach is best achieved by backing up the data automatically at a time when the data is not otherwise being accessed. That is, nobody is using the software or other means to access and manipulate the data. Windows Task Scheduler makes it easy to schedule this task to be performed during non-work hours.
Note: This guide describes functions and commands in operating systems and software not developed by Bentley Systems, and is provided as reference only. Be sure to test the operation of your backup system before needing to rely on it.
Project Manager should still be used to create project backup files. Among other things it is useful for:
If non-Express versions of SQL Server are used, SQL Server Management Studio can be used to create and schedule jobs, such as backing up the database. Consult the SQL Server documentation. See also:http://msdn.microsoft.com/en-us/library/ms191239.aspx Schedule the backups of the database to occur at the same time that the project folders are backed up to prevent discrepancies between the drawings and the database.Jobs cannot be scheduled with SQL Server Management Studio for SQL Server Express, however. This section describes how to achieve automatic, periodic database backups for SQL Server Express using an SQL script, a batch file (.bat) file and the Windows Task Scheduler.
Using a text editor such as Notepad, create a SQL script file named "backup.sql" containing the following text:
declare @filename varchar(255)set @filename = 'X:\Backup\Promise' + datename(yy,getdate()) + datename(mm,getdate()) + datename(d,getdate()) + '.bak'backup database promise to disk = @filename
The first line declares a variable that will be used in the script.The second line builds a path and file name for the actual SQL backup file from the string "X:\backup\Promise" and the date when the script is run and assigns the file name to the variable declared in the first line. The backup file will be named something like "Promise2009June10.bak" and it will be placed in a folder named "X:\backup". Change the path and file name to suit your needs. Backing up the data to a different machine than the machine hosting the "live" data is recommended as further protection against data loss.
The third line backs up a database named "promise" to disk with the file name that was stored in the variable @filename in line 2. Change the name of the database to be backed up to match the name of the database the software is using. Check the Project Database area of the Setup dialog for this information.
Again using a text editor such as Notepad, create file that contains the following lines and save it with a .bat extension, for example RUN_SQL_BACKUP.BAT:
sqlcmd -S LOCALHOST\BENTLEYECAD -i c:\backup\backup.sql -o c:\backup\output.txtxcopy /e /v /y "C:\promis-e Data\My Projects" X:\Backup\projects
The first line runs the script created in the previous section. It connects to the BENTLEYECAD instance of the SQL Server running on the local machine, inputs the backup.sql file and performs the instructions it contains, and outputs a result file containing details of the process and if it was successful.
"BENTLEYECAD" may need to be changed to another instance such as "ECTECAD" or to no instance instead. Check the Setup dialog to verify the instance name.
Also modify the first line to match the path and filename of the script and the output file.
The second line copies the contents of the My Projects folder to a backup location. This line is optional but ensures the drawing files are backed up at the same time as the SQL database to keep the drawings and database synchronized. Modify the My Projects path to reflect the actual path where the projects are located.
To find out more about the XCOPY command, select Start > Run and Type "CMD" to open a DOS command prompt window. Then type "xcopy /?" without the quotes to see the available switches and their uses, or search the internet for "xcopy switches"
Note: If the paths contain spaces in either line of the script, use quotes around them.
Test the operation of the script and batch file and perform a restore before relying on them. Run the .bat file and observe what happens. A .bak file should be created in the path specified in the sql script.
SQL Server Management Studio (SSMS) can be used to restore the database. SSMS is installed by default when some versions of SQL Server are installed. Otherwise it is available in the promis.e/Substation installation file or CD, or it can be downloaded from the Microsoft website. The database can be restored to a different name with different file names of the database and transaction log files so the original, working database is not disturbed.
Use Windows Task Scheduler to run the .bat file periodically. Ideally this would be done during non-work hours, perhaps nightly.
Periodic backups can be scheduled within the Enterprise Manager without manually creating a script. Please consult the Oracle documentation. See also the following link: http://www.oracle.com/technology/obe/10gr2_2day_dba/backup/backup.htm
Schedule the backups of the database to occur at the same time that the project folders are backed up to prevent discrepancies between the drawings and the database.
Backup Project
Backup Your Data
How to: Create a New Database From an Existing Database Backup (SQL Server Management Studio)http://technet.microsoft.com/en-us/library/ms186390%28v=sql.105%29.aspx
Using the sqlcmd Utility: http://msdn.microsoft.com/en-us/library/ms180944(SQL.90).aspx
Download Microsoft SQL Server Management Studio Express 2005:http://www.microsoft.com/downloadS/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en
Backing up an Oracle database:http://www.oracle.com/technology/obe/10gr2_2day_dba/backup/backup.htm
Introduction to Backup and Restore Strategies in SQL Server: http://msdn.microsoft.com/en-us/library/ms191239.aspx