You are on page 1of 28

7.

iTWO costX® standalone


Database Backup and Recovery
Copyright © 2020-2021 RIB Technologies Pty Ltd

All rights reserved.

This document may not be reproduced, in whole or in part, without the express written authority
of RIB Technologies Pty Ltd.
iTWO costX® Standalone Database Backup and Recovery

Contents
1 General Information 5
2 Types of Backups 5
2.1 Full Database
............................................................................................................................
Backup 5
2.2 Backing up............................................................................................................................
Selected Data 5
3 Default Backup Settings 6
3.1 Default Path
............................................................................................................................ 6
3.2 Filename ............................................................................................................................ 6
Manual
.............................................................................................................................
Backups (Starting from iTWO costX®) 6
Command
.............................................................................................................................
Line Backups 6
Partial
.............................................................................................................................
Backups 6
4 Disk Space Provisioning 7
4.1 Backup Path
............................................................................................................................ 7
4.2 External Storage
............................................................................................................................
of Database Backups 7
5 FAQ - Database and Backups 8
5.1 Where is the
............................................................................................................................
iTWO costX® Database located? 8
5.2 What Data............................................................................................................................
is included in the Full Database Backup? 8
5.3 Can I just copy
............................................................................................................................
/ backup the database? 8
6 Manual Database Backup 9
7 Command Line Backup Utility 10
7.1 Command
............................................................................................................................
Line Backup Utility Usage 11
7.2 Command
............................................................................................................................
Line Backup 13
7.3 Automating
............................................................................................................................
Command Line Backup 15
8 Automated Database Backup 17
9 Taking a backup manually 20
10 Troubleshooting Failed Backups 21
10.1 Cannot write
............................................................................................................................
the backup file 21
10.2 The live database
............................................................................................................................
contains corrupted data 21
11 Recovery 22
11.1 Full Database
............................................................................................................................
Recovery 22
Full.............................................................................................................................
Disk / Computer Crash 22
Database
.............................................................................................................................
Corruption only 22
11.2 Restore Database
............................................................................................................................
from Backup 23
11.3 Command
............................................................................................................................
Line Restore 24

3 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery

11.4 Partial Data


............................................................................................................................
Recovery Using RecoverX 25
Starting
.............................................................................................................................
RecoverX 25
Using
.............................................................................................................................
RecoverX to Extract Data 25
Importing
.............................................................................................................................
the Restored Data to iTWO costX® 25
RecoverX
.............................................................................................................................
Usage Tips 25
12 Database Corruption Causes 26
12.1 Unexpected
............................................................................................................................
computer shutdown 26
Description
............................................................................................................................. 26
Diagnosis
............................................................................................................................. 26
Prevention
............................................................................................................................. 26
12.2 Running ............................................................................................................................
out of disk space 26
Description
............................................................................................................................. 26
Diagnosis
............................................................................................................................. 26
Prevention
............................................................................................................................. 26
12.3 Copying ............................................................................................................................
the database while in use 27
Description
............................................................................................................................. 27
Diagnosis
............................................................................................................................. 27
Prevention
............................................................................................................................. 27
12.4 Locking the
............................................................................................................................
database file while in use 27
Description
............................................................................................................................. 27
Diagnosis
............................................................................................................................. 27
Prevention
............................................................................................................................. 27
12.5 Hard drive
............................................................................................................................
corruption 28
Description
............................................................................................................................. 28
Diagnosis
............................................................................................................................. 28
Prevention
............................................................................................................................. 28
12.6 Faulty RAM
............................................................................................................................ 28
Description
............................................................................................................................. 28
Diagnosis
............................................................................................................................. 28
Prevention
............................................................................................................................. 28

4 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery General Information

1 General Information
This document applies to iTWO costX® in a Standalone Configuration. If you are using iTWO costX® in a
Network Configuration, refer to the iTWO costX® server Database Backup and Recovery guide.

2 Types of Backups
A backup in iTWO costX® can either be a full database backup or a backup of selected data. This
document primarily covers full database backups.

2.1 Full Database Backup


By default, the Standalone version of iTWO costX® does not back up the database automatically.
However, you can automate the backup process by using a batch file and the Windows Task Scheduler.
For details, see Automated Database Backup.

You can also create a manual backup at any time. For details, see Manual Database Backup.

2.2 Backing up Selected Data


Exporting Data is the other type of backup you can do. It just has the name ‘Export’instead of ‘Backup’.
You can do an export at any time using iTWO costX®. It doesn’t back up the whole database - just the
data you are interested in.

Some organisations have a policy to do an ‘Export Building’during the day at various times to back up
the building they are working on.

iTWO costX export files are saved as .EXF files and can be safely done at any time while iTWO costX® is
running and in use. EXF files can also be imported at any time and can be used to exchange data with
other users / offices / organisations etc.

See iTWO costX® Help for more information on the specific type of data backup you want to do.

NOTE: To avoid corruption, the live database should never be copied while iTWO costX® is running.
See the topic Database Corruption Causes for more details.

5 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Default Backup Settings

3 Default Backup Settings


3.1 Default Path
The default backup path is: C:\ProgramData\Exactal\CostX\Backup

NOTE: If iTWO costX® was upgraded from an old version, the backup path may be set to the old
default path which is: C:\ProgramData\Exactal\CostX\Data\Backup

Manual backups are automatically saved to the default backup path. When performing command line
backups, it is possible to define a different backup location. If a different backup path is used, ensure
the folder exists and the user running iTWO costX® has permission to write to the backup path and
parent folders.

3.2 Filename
Manual Backups (Starting from iTWO costX®)

The backup filename is in the format 'YMD.HMS Vision.ebk' where YMDHMS is the Year followed by
Month then Day, Hour, Minute, and Second. An example would be 20140505.125930 Vision.ebk. This
format allows the files to automatically be in order of time when sorted according to their filenames.

Command Line Backups

You can define the file names for backups created via the command line. It is recommended to choose a
file name that incorporates a date and time to ensure it is unique.

Partial Backups

While the backup (EBK) file is being created, it will have a .partial extension in the backup folder. Once
the backup is complete it is renamed to remove the .partial extension.

6 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Disk Space Provisioning

4 Disk Space Provisioning


4.1 Backup Path
Ensure the disk you are backing up to has plenty of disk space so that the backups can be completed
successfully.

Typically, the size of an EBK backup file is approximately 30% of the size of the database. The actual size
of the backup file can vary from 10% to 50% depending on the proportions of different types of data
stored in the database, and other factors such as the time since a compact was done or data was
deleted. Although the size of each EBK file is usually around 30% of the database size, for the purposes
of provisioning disk space, it is safer to work on 50% of the database size.

To check the size of your database, simply right click on the Database folder and choose Properties.

Note that the size of the database will grow over time and vary depending on the type of work being
done. As an example, if your database is 12GB, and the backup file size is 50% of that, then each backup
is 6GB. With 14 backups kept you will need to allow a minimum of 84GB free space. Over time, if you
have more projects in the database, the size will grow, so you might need to allow more GB per backup.

4.2 External Storage of Database Backups


You should also do an external backup (eg. Tape Backup or similar) of the backup file (.EBK file) regularly
so that it is safely stored away from the iTWO costX® computer in the case of disk crash, theft or fire
etc.

7 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery FAQ - Database and Backups

5 FAQ - Database and Backups


5.1 Where is the iTWO costX® Database located?
The live database consists of a folder containing many files and sub-folders. The default location is:

C:\ProgramData\Exactal\CostX\Database

IMPORTANT: Files and sub-folders within the database folder are not user editable. To avoid
potential database corruption, do not open or modify files in the database folder.

5.2 What Data is included in the Full Database Backup?


The database holds all the user data, including the activated license record, EXCEPT the drawing files
(ie. CAD files / PDFs etc). The database only holds a reference to the full path and file name of the
drawing file. Therefore you should backup the drawing files separately as well.

Most organisations using iTWO costX® have project folders on the network anyway which are already
part of their standard backups and this is where the drawings are placed.

5.3 Can I just copy / backup the database?


Do not backup the database folder by copying or with external backup software while the CostX
Database service is running. Some backup programs lock the file in a way that can cause database
corruptions to occur if files are in use while a backup is being done. See the topic Database Corruption
Causes for more details. Note that the topic Taking a backup manually when the EBK backups are failing
provides details about safely making a backup of the database by copying it.

IMPORTANT: Do not copy the database from one computer to another as it may result in data
corruption and licensing issues. iTWO costX® includes a database transfer utility which provides a safe
method to transfer your iTWO costX® data from one computer to another. Please contact RIB iTWO
costX support via our Support Portal for further information if you wish to transfer your database.

8 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Manual Database Backup

6 Manual Database Backup


To back up your iTWO costX® data manually, follow the steps below:

1. Open the iTWO costX Options dialog, and in the left pane, click the Database tab. The Database
page is shown below.

2. In the right pane, click the Backup button to start the backup.

3. Once the backup is complete, an ebk backup file is created in the backup path and a message is
displayed showing the location and filename of the backup file. Take note of this location.

4. Click the OK button to close the message.

5. Locate and backup to the same location any drawing files (eg .DWG or .DXF), Excel files (.XLSX),
iTWO costX exchange files (.EXF) or saved filter files (.FLT).

9 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Command Line Backup Utility

7 Command Line Backup Utility


iTWO costX® provides a command line utility called exbackup.exe which allows backup and restore
operations from the command line. iTWO costX® data can be backed up with automated scripts using
this utility. exbackup.exe is located in the Utilities folder which by default is:

C:\Program Files\Exactal\CostX\Utilities

NOTE: If you plan to backup or restore the database using exbackup.exe, you will need to set the
"Command Line Backup Password". You can set the password in the Database section of iTWO costX®
Options or during installation when prompted as shown below.

10 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Command Line Backup Utility

7.1 Command Line Backup Utility Usage


exbackup -backupto|-restorefrom <file name>
-p <port number>
-password <backup password>
[-h <hostname>]
[-d <database name>]

The table below provides more details of the parameters that may be specified on the command line.
Parameter names are case sensitive and must be separated with spaces.

Parameter Mandatory? Value Required Notes


-backupto Yes full path and file To back up the database to an ebk file, use the -backupto
name of the option.
OR backup file.
To restore a database from an ebk file, use the -restorefrom
option.
-restorefrom
If this option is omitted, exbackup.exe will not back up or
restore and instead will display the usage.
NOTES:
1. Only one of the options backupto or restorefrom can be
used. Do not use both options at the same time.
2. The <file name> parameter must include the full path.
Ensure the path exists and you have permission to write
to it.
3. If the path contains spaces, ensure it is surrounded with
double quotes.
4. It is recommended that the ebk file extension is used for
the file name.
Example usage:
-backupto C:\ProgramData\Exactal\CostX\Backup
\file.ebk
-restorefrom "C:\CostX Backups
\MyBackupFile.ebk"

-p Yes database port To backup an iTWO costX® standalone database, use port
number 17005.
Example usage:
-p 17005

-password Yes command line The iTWO costX® installer prompts for a "Command Line
back up password Backup Password" to ensure that exbackup.exe can only
connect to the database with proper authentication. Use the
password set during installation with the -password
parameter.
TIP: If no "Command Line Backup Password" was set during
installation, you can set it in the Database section of iTWO
costX® Options or by running the installer again.
NOTES:
1. If the password contains any spaces, non-english
characters, punctuation or special characters, it must
be surrounded with double quotes.
2. If the password contains non-english characters, it will
only work on the command line if the computer is
running Windows in the language of the character. For

11 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Command Line Backup Utility

Parameter Mandatory? Value Required Notes


example, if you enter the Japanese character during
installation, it will only work with exbackup.exe on the
command line if it is Japanese Windows.
Example usage:
-password mysecret
-password "V3ry$3cur3"

-h No IP address, or If this option is omitted, the default address 'localhost' is


hostname used.
When backing up a iTWO costX® standalone database,
exbackup.exe must be run on the same computer as the
database. This option should therefore be omitted for iTWO
costX® standalone.

-d No costx Under normal circumstances there is no need to use this


option. If this option is omitted, costx is used.
Example usage:
-d costx

12 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Command Line Backup Utility

7.2 Command Line Backup


This topic covers backing up data using exbackup.exe. For full usage details for exbackup.exe,
refer to the topic Command Line Backup Utility Usage. For information on how to automate command
line backup using a batch file, see Automating Command Line Backup. For step by step instructions on
how to restore data using exbackup.exe, refer to the topic Command Line Restore.

To back up the iTWO costX® database using the command line utility exbackup.exe, follow the
instructions below.

1. Login to the computer with iTWO costX® installed.

2. Open the command prompt and change to the Utilities folder located in the main iTWO costX®
folder.
a. To open the Command Prompt, at the Start->Run prompt, type cmd, and press enter.
b. If the command prompt is displayed other than C:\> then type the command c: and press
Enter. Next, type cd\ and press Enter. The prompt should now be displayed as C:\>.
c. At the C:\> prompt, change directory to the iTWO costX® Utilities folder by typing the
following command and press Enter:
cd "Program Files\Exactal\CostX\Utilities"

NOTE: If iTWO costX® was installed to a different location, enter that path instead.
Ensure the path is enclosed with double quotes as shown above. Your prompt should now
include the path.

3. Next, type the following command replacing <filename> with the full path and name of the ebk
backup file, and replacing <backup password> with the command line backup password that was
set during install. It is recommended to choose a filename that incorporates a date and time to
ensure it is unique. An example of a good "<filename>" is
"20151015.125930_CostX_Backup.ebk".

exbackup -backupto "<filename>" -p 17005 -password "<backup password>"

An example is shown below:

13 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Command Line Backup Utility

4. Press Enter to start the backup.

NOTE: If the backup cannot be completed, an error is displayed and the command prompt is
shown again. For example, in the screen shot below, the password was entered incorrectly.

Press the up arrow to display the previous command, correct the error and run the command
again.

5. Once the backup is complete, a message is shown that the Backup file was successfully created.

14 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Command Line Backup Utility

7.3 Automating Command Line Backup


You can automate the process of command line backup using a batch file. A batch file is a special kind of
text file with a ".bat" extension. It can contain one or multiple commands, which are executed when
you double-click the file. This saves you the trouble of retyping commands. Any task that can be
performed from a command line can be automated using a batch file.

To create a batch file to automate command line backup of iTWO costX® data, follow the steps below:

1. Open a text file, such as a Notepad or WordPad document.

2. Copy the following code to your text file.

@echo off
echo.
echo iTWO costX Standalone Backup
echo.
"C:\Program Files\Exactal\CostX\Utilities\exbackup.exe" -backupto "C:
\ProgramData\Exactal\CostX\Backup\%date:~0,4%%date:~5,2%%date:~8,2%.%time:~0,2%%time:~3,2%%
time:~6,2%_CostX_Backup.ebk" -p 17005 -password "P@ssword"
pause
cls
exit

3. Move lines 6 and 7 up to line 5 so that the coloured elements are all on the same line.

4. Modify the coloured elements if required.

· The green element is the location of the Command Line Backup Utility exbackup.exe.
The example above uses its default path. If iTWO costX® is installed to a location other
than the default, enter that path instead.
· The red element is the path of the backup folder. The example above uses the default
backup path. If you wish to back up the files to a different location, enter that path
instead.
· The blue element is the name of the backup file, which is in the format
'YMD.HMS_CostX_Backup.ebk' where YMDHMS is the Year followed by Month then Day,
Hour, Minute, and Second. An example would be 20190314.161800_CostX_Backup.ebk.
This format allows the backup files to automatically be in order of time when sorted
according to their file names.
You can change the format of the file name if desired. If you wish to use the above format,
you may need to modify the digits after each tilde (~), depending on the Date and Time
format used on your computer. The three "%date:~x,x%" variables in the above example
are used to retrieve Year, Month, and Day; and the three "%time:~x,x%" variables are used
to retrieve Hour, Minute, and Second. You can use the two digits after each tilde to specify
the position and the number of characters you want to retrieve from the date or time of
your computer. For example, on a computer that uses the format yyyy/mm/dd and
hh:mm:ss, the position of each character is as follows:

Date Format y y y y / mm / d d Time Format h h : m m : s s


Position 0 1 2 3 4 5 6 7 8 9 Position 0 1 2 3 4 5 6 7

15 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Command Line Backup Utility

To retrieve Month, "%date:~5,2%" should be used, which means you want to retrieve two
characters from the date on your computer, starting from the fifth character (numbering
begins from 0).

· The purple element is the "Command Line Backup Password" that was set during install. If
no "Command Line Backup Password" was set during installation, run the installer again to
set it.

5. Select File > Save As.

6. Save your file with the file extension .bat, for example, CostX-Backup.bat.

To run your batch file, double-click the file.

To edit your batch file, right-click the file and select Edit.

TIP: To prevent the backup files from filling up your disk space, you can add the following command
to your code to delete files older than certain days when creating a new one. Replace <path> with the
path of your backup folder. The number 14 indicates that files with a last modified date earlier than or
equal to the current date minus 14 days will be removed. You can change the number if needed. If there
are not any files that are 14 days older than the current date, no files will be deleted and the message
"ERROR: No files found with the specified search criteria." will be displayed.

forfiles /p "<path>" /s /m *.* /c "cmd /c Del @path" /d -14 2>&1 | find /v /i "ERROR: No files found with the
specified search criteria."

The above command must be used with caution because all files in your backup folder that are older
than the specified number of days will be removed. It is highly recommended that you check the files in
your backup folder and ensure that the older files can be removed before using this command.

The following is an example backup script with the above command added.

@echo off
echo.
echo iTWO costX Standalone Backup
echo.
forfiles /p "C:\ProgramData\Exactal\CostX\Backup" /s /m *.* /c "cmd /c Del @path" /d -30 2>&1 | find /v /i
"ERROR: No files found with the specified search criteria."
"C:\Program Files\Exactal\CostX\Utilities\exbackup.exe" -backupto "C:\ProgramData\Exactal\CostX\Backup\%
date:~0,4%%date:~5,2%%date:~8,2%.%time:~0,2%%time:~3,2%%time:~6,2%_CostX_Backup.ebk" -p 17005 -
password "123456"
pause
cls
exit

16 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Automated Database Backup

8 Automated Database Backup


By default, the standalone version of iTWO costX® does not back up automatically. To automate the
process of backing up your data regularly, you can create a batch file to automate command line backup,
and then schedule the batch file to run automatically using Windows Task Scheduler.

For step-by-step instructions on how to create a batch file, see Automating Command Line Backup.

Once the batch file is created, follow the instructions below to schedule the batch file to run
automatically.

1. Place the batch file under a folder where you have enough permissions, for example, under C
drive.

2. In the Start Menu search box, type in Task, and then select Task Scheduler.

3. In the Actions pane on the right of the window, select Create Basic Task.

4. In the Create Basic Task Wizard window, specify a name for the backup task, and then click Next.

17 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Automated Database Backup

5. Specify how often you want to back up your iTWO costX® data and click Next.

6. Set the starting date and time of the backup, and then click Next.

IMPORTANT: The iTWO costX® computer must be powered on during the scheduled backup
time, otherwise the Task Scheduler won't trigger the backup.

18 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Automated Database Backup

7. You'll be prompted to specify the action that you want to be executed. Select Start a program
and click Next.

8. Click the Browse button to the right of the Program/script field and select the batch file you
have created, and then click Next.

9. A summary of the settings that you've made will be displayed. Click the Back button if you want
to modify the settings or click Finish to create the task.

19 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Taking a backup manually

9 Taking a backup manually when the EBK backups are failing


Normally, you should not backup the database folder itself. This is because some backup programs lock
the file in a way that can cause database corruptions to occur if the file is in use while a backup is being
done.

However, if the backups to EBK files are failing and it is some time since a backup has been taken, you
may like to manually make a backup copy of the database. This can only be done while iTWO costX® is
shut down. The steps to do this are shown below.

1. Close iTWO costX®, then stop the ‘CostX Database’, 'CostX Core' and 'CostX Auth' services.
2. Copy the database folder and paste it to your backup location, then rename it to include a date
and time so it is unique.
3. Start the service again.

IMPORTANT: Do not copy the database from one computer to another as it may result in data
corruption and licensing issues. iTWO costX® includes a database transfer utility which provides a safe
method to transfer your iTWO costX® data from one computer to another. Please contact RIB iTWO
costX support via our Support Portal for further information if you wish to transfer your database.

20 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Troubleshooting Failed Backups

10 Troubleshooting Failed Backups

Typically, there are two main reasons the backup process could fail.
· Cannot write the backup file
· The live database contains corrupted data

10.1 Cannot write the backup file


The main things to check are:

1. The Backup Path exists. The path must be spelt correctly in the Backup Path settings.

2. The user running iTWO costX® must have permission to write to the Backup Path and parent
folders to successfully create a backup of the database.

3. If the path is on the network, use a UNC drive path (\\Server\Share\) instead of a mapped drive.

4. There is sufficient free space on the drive containing the Backup Path.

10.2 The live database contains corrupted data


If the live database contains corruption, normally the backup will fail to complete. If the live database is
corrupted, it is best to contact RIB iTWO costX support. Please submit details of the issue including the
exact wording of the error message (or a screen shot) via our Support Portal at https://www.rib-
international.com/en/support/. There are several things that our support staff can try in order to assist
you in repairing the corruption.

21 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Recovery

11 Recovery

Recovery of data can be broken into two categories as follows.

· Full Database Recovery (where the whole database is lost or corrupted)


· Partial Data Recovery using RecoverX (where some data in the database is deleted / lost)

11.1 Full Database Recovery


Full Disk / Computer Crash

You will need to install iTWO costX® on the newly rebuilt computer first. An empty database will be
installed during the iTWO costX® installation.

NOTE: If you plan to restore the database using the Command Line Restore utility exbackup.exe,
you will need to set the password during installation when prompted for a command line backup
password.

To restore the database using the command line utility, continue to the topic Command Line Restore.

To restore your data from the backup database (.ebk file) using iTWO costX®, follow the instructions in
the topic Restore Database from Backup.

Database Corruption only

NOTE: Database corruption is very rare and can generally be avoided by following the guidelines in
the section Database Corruption Causes.

If the database is corrupted but the computer is intact, re-installation is required and the database can
then be restored from backup as detailed below.

1. Locate the EBK backup file you will restore from and take note of the backup path.

2. Uninstall iTWO costX®.

3. During uninstallation, you will be prompted whether to keep the database. Choose No, so that
the uninstaller removes the corrupted database.

4. Install iTWO costX®. The installer will create a new empty database which is not corrupted,
allowing the data from your EBK backup file to be restored.

5. On completion of the installation, un-tick the checkbox to run iTWO costX®.

6. Restore your data from the backup database (.ebk file) by following the instructions in the topic
Restore Database from Backup.

22 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Recovery

11.2 Restore Database from Backup


The instructions below assume iTWO costX® can be started. If iTWO costX® will not start, a command
line utility can be used to restore the data instead. For details, see Command Line Restore.

IMPORTANT: Any changes made after the last backup will be lost when the backup is restored. In
some cases, particularly when backups have not been done frequently, it may be necessary to assess
whether it is better to restore from the backup, or continue with the existing data.

To restore iTWO costX® data, follow the steps below:

1. Open the iTWO costX Options dialog, and in the left pane, click the Database tab.

2. In the right pane, click the Restore button.

3. You will be prompted to confirm to restore the database.


a. If you are certain that you wish to overwrite the current database with the database from
the backup file, click Yes.
b. If you wish to keep the current database, click No.

4. If Yes is selected, you will be prompted to choose the backup file from your backup location.
Select the file and click the Open button. All of the data in the database including the license
will be restored from the selected backup file.

5. Once the restore is complete, a message is displayed confirming that the restore was successful.
You need to restart iTWO costX® to start using the restored database. Click the OK button to
close iTWO costX.

6. Restore any other files as necessary from the backup location such as drawing files (eg .DWG or
.DXF), exported excel files (.XLS), or iTWO costX exchange files (.EXF).

7. Start iTWO costX® again.

23 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Recovery

11.3 Command Line Restore


This topic covers restoring data using exbackup.exe. For full usage details for exbackup.exe, please
refer to the topic Command Line Backup Utility Usage above. For step by step instructions to back up
data using exbackup.exe, refer to the topic Command Line Backup.

CAUTION: The current database will be overwritten by the database contained in the backup file. Any
data contained in the current database will be deleted and cannot be recovered if it is not also in the
selected backup file. DO NOT continue unless you are certain that you wish to overwrite the current
database with the old database.

To restore an iTWO costX® database from a backup file using the command line utility exbackup.exe,
follow the instructions below.

1. Login to the computer with iTWO costX® installed.

2. Open the command prompt and change to the Utilities folder located in the main iTWO costX®
folder.
a. To open the Command Prompt, at the Start->Run prompt, type cmd, and press Enter.
b. If the command prompt is displayed other than C:\> then type the command c: and press
enter. Next, type cd\ and press Enter. The prompt should now be displayed as C:\>.
c. At the C:\> prompt, change directory to the iTWO costX® Utilities folder by typing the
following command and press Enter:
cd "Program Files\Exactal\CostX\Utilities"
NOTE: If iTWO costX® was installed to a different location, enter that path instead.
Ensure the path is enclosed with double quotes as shown above. Your prompt should now
include the path.

3. Next, type the following command replacing <filename> with the full path and name of the ebk
backup file, and replacing <password> with the command line backup password that was set
during install.
exbackup -restorefrom "<filename>" -p 17005 -password "<password>"
An example is shown below:
exbackup -restorefrom "C:\ProgramData\Exactal\CostX\Backup
\20151015.125930_CostX_Backup.ebk" -p 17005 -password "mysecret"

4. Press Enter to start the restore process. The database is restored from the selected backup file.
All of the data in the database including the license is restored.

NOTE: If the restore cannot be completed, an error is displayed and the command prompt is
shown again. Press the up arrow to display the previous command, correct the error and run the
command again.

5. Once the restore is complete, a message is shown that the restore was successfully completed.

6. Open Windows Services Manager and restart the CostX Core service.

24 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Recovery

11.4 Partial Data Recovery Using RecoverX


In some cases, particularly when backups have not been done frequently, it may be necessary to assess
whether it is better to restore from the backup, or continue with the existing data. If it is deemed that
the data should be restored, a tool called RecoverX is provided to extract specific required data from
the Backup file, which can then be simply imported to iTWO costX®.

Starting RecoverX

1. Go to the iTWO costX® computer.

2. Open Windows Explorer and navigate to the Utilities folder which by default is:
C:\Program Files\Exactal\CostX\Utilities

3. Run RecoverX from the Utilities folder.

NOTE: RecoverX requires the CostX Database service to be running in order to extract the data from
the backup file.

Using RecoverX to Extract Data

1. Select an iTWO costX backup file (.EBK format). Typically these files will be stored in the backup
path.

2. RecoverX will load it for browsing. This can take some time if the backup file needs to be
upgraded or is very large.

NOTE: Sometimes during load it may say ‘Not responding’. This can be ignored – it is just very
busy loading the file.

3. Select the data you wish to export (eg. Project/Building/Rate Library etc) and click Export.

4. Choose the path and filename to save the EXF file to.

Importing the Restored Data to iTWO costX®

The exported data is saved to an EXF file which can be imported to iTWO costX®. When you try to import
the EXF to the live iTWO costX® system, make sure you use the Import iTWO costX Data as Copy option
or it will prompt that the data (eg. building) already exists and ask you if you want to overwrite.

RecoverX Usage Tips

· The Expand All button shows the entire data tree.

· To export a building, expand the Project it is in and select the required building before clicking
Export.

· Use Search to dynamically filter the displayed data records.

· To open a different backup file, exit and run RecoverX again.

25 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Database Corruption Causes

12 Database Corruption Causes

The database system used by iTWO costX® is very stable and corruption is very rare. When corruption
does occur, it is important to determine the reason for the corruption so that it can be avoided in the
future. This section lists the possible causes of database corruption and what can be done to diagnose
and avoid them.

12.1 Unexpected computer shutdown


Description

If the computer on which the database is located loses power or is rebooted without allowing iTWO
costX® to shutdown, this can cause database corruption.

Diagnosis

Was the computer affected by a power failure, power spike, blue screen of death, or similar hang or
crash?

Prevention

· Using a UPS (uninterruptable power supply) can allow the computer to be shutdown gracefully
when unexpected power changes happen.
· As far as possible avoid doing a hardware reboot (rather than choosing shutdown or reboot from
the Start menu) while iTWO costX® is open.

12.2 Running out of disk space


Description

If disk space is exhausted, the CostX Database service will usually try to shut down as a protection
mechanism to avoid partial writes and database corruption. If the database service was unable to
shutdown and there is a failure writing all data to disk, the database could contain partial updates,
potentially leading to corruption.

Diagnosis

Look at the space available reported by Windows Explorer for the drive containing the database, as well
as the drive containing the temporary files for the user accessing the database.

Prevention

Monitor the amount of free space available on the drive used for the database, as well as the drive on
which the user’s temporary files are created.

26 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Database Corruption Causes

12.3 Copying the database while in use


Description

If the database is copied while in use, the copy produced might contain partial writes of data. This
would produce a corrupt copy of the database. Also, as described in the topic Locking the database file
while in use, not only may the copy be corrupted but the live database may also become corrupted.

Diagnosis

Check for any automated backup system that might copy the database when backing up the computer
on which the database runs.

Prevention

· Always ensure that the CostX Database service is shut down before copying the database folder.
· Exclude the database folder from the list of files backed up with automated backup tools.

12.4 Locking the database file while in use


Description

Some backup software, virus scanners, and disk defragmentation programs obtain an exclusive lock on
files while working with them. If the database is currently active this can cause corruption of the
database due to data being partially written to the file.

Diagnosis

Check for backup, virus scanning or defragmentation tasks set to run using the windows scheduler or by
their own mechanisms.

Prevention

· Always ensure that iTWO costX® is closed and the CostX Database service is shut down before
running a backup, defrag, or virus check.
· Exclude the database folder from the list of files backed up with automated backup tools and
virus scanners.
· Do not use Shadow Protect (a product from StorageCraft (http://www.storagecraft.com) which
provides incremental backups of the disk).

27 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)
iTWO costX® Standalone Database Backup and Recovery Database Corruption Causes

12.5 Hard drive corruption


Description

Over time, areas of a hard drive can develop errors – when this happens, files occupying that space can
become corrupted. Hard drives can crash and stop working altogether – although experts may be able to
recover the file from a crashed hard drive, it is likely that the database will be corrupted.

Diagnosis

When experiencing errors over a small area of the hard drive, clicking or grinding sounds can generally
be heard while the computer is accessing the hard drive. The computer will also generally begin to
operate more slowly than it had otherwise done.

If your hard drive supports S.M.A.R.T. you may see a warning when your computer is booting.

For major damage to the hard drive, the system will generally not be able to boot, or will crash with a
blue screen.

Prevention

· Regular backups will allow for recovery of the database in the event of a hard drive crash.
Individual projects can be backed up by exporting to EXF.
· Using hard drives configured as a RAID device can allow for seamless recovery in the event of
the failure of a single drive in the array. Be careful to choose a RAID level which doesn't cause a
performance impact.

12.6 Faulty RAM


Description

Like any hardware component, RAM can be faulty. RAM errors can cause subtle errors that corrupt data
slowly, or can cause blue screen crashes and other obvious errors.

Diagnosis

Special memory testing software is available which can identify errors in the computer’s memory. One
such testing program is available from http://www.memtest86.com/.

Prevention

· Retaining backups for a period of time can allow data to be restored from before memory faults
began.
· Running memory tests periodically can ensure that such errors are detected as soon as possible.

28 www.i twocos tx.com Copyri ght © 2020-2021 RIB Technol ogi es Pty Ltd (NOT TO BE REPRODUCED)

You might also like