Etere Support notes

20.7 INTERNAL TESTING WITH CUSTOMER DATABASES

This guide will walk you through the procedures to follow when using a customer's database for internal testing. First, you will learn how to create a backup of an existing database, so that you can guide customers through the process when necessary. Keep in mind that this procedure should be carried out by the customer or their IT department, unless Fabio specifically instructs us to assist the customer with this task as well. Next, you will learn how to restore the customer's database in our test environment. Then, we will cover the additional configuration steps required to ensure that the restored database is ready for testing. Finally, you will learn how to properly configure Etere in your virtual machine to perform tests using a customer's database.


First, let's see how to create a backup of an existing database.

Since you cannot simply copy a database using Ctrl+C and Ctrl+V, you'll need to follow a specific procedure in SQL Server Management Studio (hereafter referred to as SSMS).

As shown in the image, once you have connected to the SQL Server instance using SSMS, expand the Databases node, right-click the database you want to back up, hover on Tasks to display the available operations, and select Back Up...

01.webp

In the Back Up Database window, on the General page, you can check the destination path where the .bak file will be saved. Keep it in mind if you need to move the generated .bak file from its configured directory to another location on the server.

02.webp

On the Backup Options page, select Compress backup from the Set backup compression drop-down menu. Then, click OK to start the backup process.

03.webp

Once the backup process is complete, a confirmation message will appear.

04.webp


Now, let's see how to restore a database from a backup.

Assuming that the customer has provided us with a backup of their database, we first need to copy the .bak file to SGS8. Let's start by identifying the appropriate location for the file. Right-click the SQL Server instance, select New Query, enter the following query in the query editor, and press F5 on your keyboard to execute it:

SELECT
    SERVERPROPERTY('InstanceDefaultBackupPath') AS DefaultBackupPath;

The query will return the default backup path configured for the SQL Server instance.

05.webp

For example, on SGS8, the path is D:\SQL\BACKUP.

To make the backup file easier to locate, it is recommended to create a subfolder within this directory, naming it after the relevant customer code, and placing the .bak file inside it.

Next, we need to create an empty database in which to restore the customer's backup. To do so, follow these simple steps.

Right-click the Databases node and select New Database...

06.webp

In the New Database window, enter the name of the database you want to create in the General page, then click OK.

07.webp

Additional parameters will need to be configured, but we will review them after restoring the .bak file to this database.

To do so, right-click the newly created, empty database, hover on Tasks, then Restore, and select Database... from the submenu.

08.webp

In the Restore Database window, select Device in the Source section, then click the [...] button to open the Select backup devices window. Click Add to open the Locate Backup File window. Navigate through the folders in the left panel and select the appropriate .bak file in the right panel. Once the file has been selected, click OK in both windows to confirm your choice and return to the Restore Database window.

09.webp

Next, go to the Options page and select Overwrite the existing database (WITH REPLACE). Then, click OK to start the restore process.

10.webp

Once the restore is complete, a confirmation message will appear.

11.webp

However, we still need to perform a few simple operations to ensure that the restored database is fully ready for testing. First, right-click the newly restored database and select Properties.

12.webp

In the Database Properties window, open the Options page and configure the following settings:

 • Recovery model: Simple
 • Compatibility level: SQL Server 2017 (140)

Under Other options, in the Automatic category, set the following options to True:

• Auto Close
• Auto Create Statistics
• Auto Shrink
• Auto Update Statistics

13.webp

It is also important to assign a new Service Broker identifier to the database and enable it. Additionally, we need to ensure that the database's TRUSTWORTHY property is set to ON.

To do so, execute the following statements against the restored database by replacing [DB_name] with the actual name of the restored database (remember to keep the square brackets). Execute each statement separately.

ALTER DATABASE [DB_name]
SET NEW_BROKER WITH ROLLBACK IMMEDIATE;

ALTER DATABASE [DB_name]
SET TRUSTWORTHY ON;

Lastly, as an additional precaution against potential issues that may arise when associating your Etere instance to the restored database, we need to manually create the two auxiliary databases that will be later used for Logs and Doma.

Follow the steps outlined previously to create two new empty databases and accordingly configure their parameters in Properties. To make them easier to identify in Etere, give each database the same name as the restored database, adding the suffixes _Logs and _Doma, respectively.

Next, launch Etere Configuration, open the Settings module, and configure the connection to the SQL Server instance where the customer's database was restored. Then, configure Etere to connect to the restored database and the corresponding Doma and Logs databases.

14.webp

Once you close the Settings module, you will be prompted to restart Etere to apply the changes.

Restarting Etere ensures that the various Etere applications load the updated database connection settings, preventing potential errors caused by inconsistencies between the old and new configurations.

15.webp


To perform a proper set of tests using the customer's database, it is important to ensure that the restored database and its corresponding Doma and Logs databases are all updated to the latest available version. This helps rule out the possibility that an issue you are trying to reproduce is caused by an outdated database version or outdated database content, such as stored procedures.

To do so, launch EtereUpdate.exe and set the databases you’ve created in the fields Database Etere 1-6 Main, 3-6 Doma, and 5-6 App Logs fields. Click on the corresponding checkboxes on the far left of the EtereUpdate.exe interface to select them (if you need to reproduce an issue in EtereWeb, check as well the EtereWeb instance to ensure that EtereWeb points to the restored databases rather than the original databases), then click the → Update button to start the update process.

16.webp

Once the update process is complete, the screen should look like the example provided.

17.webp

If you encounter any issues, remember to check su.etere.com and ask your colleagues for assistance before escalating the issue to the Development Department.


Please note: depending on the issue being investigated, a .bak of the customer's Historical database may also be required. The Historical database may contain data related to archived assets, schedules, commercial contracts, and so on, depending on the customer's configuration.

Alternatively, if the customer's existing Historical data is not required to reproduce the issue, an empty database can be created and used as the Historical database for testing purposes.

The steps for restoring a Historical database backup or creating an empty database are the same as those outlined in this guide.

01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17