Share this page

# Back up and restore data

This topic describes how to back up and restore ALM Octane data of a shared space.

In this topic:

## Data locations

ALM Octane stores its information in the following components:

- A relational database (either Oracle or SQL Server). This is where the most important system data are located. The relational database is the most important component of the backup.

  Database systems support hot backup procedures and provide the ability to restore operations to the last second before the system crash.

- Elasticsearch. Elasticsearch stores trend data, audit information, run history, search information, and additional miscellaneous items.

- The repository folder on your file system. ALM Octane includes its own file system repository where attachments, manual scripts and other artifacts are kept. The default location for this folder is:

  - Linux: /opt/octane/repo

  - Windows: C:\Program Files\octane\repo

To fully back up ALM Octane, you need to back up all of its components. Storing each backup in a separate location facilitates their recovery.

You can back up a shared space and then restore it from backup within the original ALM Octane instance. For example, suppose you want to delete a large number of entities and verify that there are no unexpected results. You can back up your space, perform the deletion, and then restore the original data if you need to undo the action.

Note: Audit data is only saved in the Elasticsearch database . To preserve audit data, make sure to back up your Elasticsearch database. You may want to truncate the audit table to improve performance.

Back to top

## Backup frequency

Database systems such as Oracle and SQL Server usually support hot backup procedures and provide the ability to restore operations to the last second before the system crash. However, in ALM Octane, it is only possible to take a periodic snapshot of the Elasticsearch and ALM Octane repository, but not the relational database.

Therefore, how often you should back up is determined by the amount of down time your site can tolerate. If the amount of tolerated time is one day (meaning, the company is fine with the ability to restore the operation to the state of 24 hours ago), the suggested backup frequency could be defined as one day. If the amount of tolerated time is 12 hours, backups should run every 12 hours.

Example: ALM Octane operations on SaaS are backed up every 4 hours. In most cases, hot backups and dumps/snapshots should then be either moved to a separate location or put on removable media for storage.

In addition, follow these guidelines:

- Back up each component as closely as possible, one after the other.

- Back up ALM Octane during quiet times to minimize missing files, broken file associations, and time inconsistencies between the three components.

Tip: To back up the relational database, use the database's backup mechanism and save the resulting files and folders. Open files do not pose a problem during the backup, since most files are not locked by ALM Octane.

## Backup order

When preparing to do a backup, consider the following:

- Time may elapse as you back up each of these components. In terms of time difference tolerance, the time as specified in the relational database is used as the determining factor. When you restore ALM Octane, it is the data and timestamps stored in the relational database that users see. Keep this in mind when restoring.

- If you backed up your relational database, added files, and only then backed up the repository, the files exist after restore, but ALM Octane will not see any associations to those files. As a result, they will eventually be deleted.

  Conversely, if you backed up the repository, added files, and only then backed up the relational database, ALM Octane might report that you have some broken associations, as the files do not exist in the repository while ALM Octane tries to find them.

Recommended sequence

For best results, follow this the sequence for your backup:

1. Always back up the database first. Use the database vendor's, or commercially-available, tools to perform a hot backup (such as Oracle RMAN). We recommend that you take a snapshot (dump) before performing any major operations on the database, such as an upgrade, data migration (such as from Agile Manager to ALM Octane), or massive import.

2. Back up Elasticsearch next. Elasticsearch is a NoSQL database geared toward fast textual indexing and search. You can take a snapshot of the Elasticsearch indexes periodically using REST API commands from any programming language (for example, JavaScript). Kibana is an example of a tool recommended by Elasticsearch for issuing REST API commands.

   See https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html on the Elasticsearch site.

   To back up properly in a clustered Elasticsearch environment, attach shared storage to which snapshots from each node can be saved.

3. Lastly, back up the ALM Octane repository. Make a complete backup using operating system capabilities (tar, zip) or commercially-available tools.

Back to top

## Prepare to back up a shared space

Before you begin, collect the required space information.

1. Get space information by issuing this SQL query against the site admin schema:

   SELECT sp_id, sp_logical_name, sp_mode, sp_schema_name, sp_version

   FROM shared_space

   WHERE sp_id = {SP_ID}

2. Locate your repository (storage) path: CD /<repo path>/storage/sharedspaces/sp{SP_ID}

Note:

- These examples refer to the deployment of ALM Octane on Linux, but they can be adjusted to Windows folders as required.

Back to top

## Back up a shared space

To back up data belonging to a specific space, you need to back up the relevant database schema, zip the relevant part of the ALM Octane repository, and take a snapshot of the associated index in Elasticsearch.

Step 1: Back up the database schema

Use database tools to back up the schema. For example, with the Oracle expdb utility:

- For Oracle: expdp <admin conn> schemas=< SP_SCHEMA_NAME > dumpfile=<dumpfile> directory=<directory>

  SP_SCHEMA_NAME is the value obtained in the preparation step above.

- For SQL Server, see Full back up to disk to default location.

Step 2: Back up the Elasticsearch index

1. Use a REST API client to get the relevant Elasticsearch index name:

       curl 'http://<elastic host>:9200/_cat/indices/mqm_<sp_logical_name>*'

   For Windows, download curl for Windows.

2. Take a snapshot (backup) of the index. For details, see: Snapshot module.

   The general flow will be:

   1. Create a repository (if none exists).

   2. Back up the specific indexes.

   For example (after creating a repository):

   curl -XPUT "http://<elastic host>:9200/_snapshot/<repository_name>/<snapshot_name>?wait_for_completion=true&pretty" -H 'Content-Type: application/json' -d'

   {

   "indices": "mqm_<sp_logical_name>*",

   "ignore_unavailable": true,

   "include_global_state": false

   }

   }

   '

Step 3: Back up the ALM Octane repository

1. Go to the repository directory in your ALM Octane installation directory.

2. Locate the relevant subdirectory using this command:

       cd /<repo path>/storage/sharedspaces/sp{SP_ID}

3. Create a zip file using this command:

       tar cvzf {BACKUP_DIR}/sp{SP_ID}.trz

4. For Windows use 7-Zip or another compression tool to compress the repository.

Back to top

## Prepare to restore the shared space

Since you will continue to use the shared space, do not delete it from the site admin console. Instead, disable the shared space.

Prepare ALM Octane

1. In ALM Octane site settings, access Site Admin > Spaces.

2. Select your space (for example, default_shared_space).

3. Click Deactivate Space.

Prepare the database

Connect to the database as an admin user:

- For Oracle Schema (user):

  The user needs to be deleted: Drop user <SP_SCHEMA_NAME> cascade;

- SQL Server:

  During restore there is an option to overwrite. If you do not overwrite, the database needs to be deleted: Drop database <SP_SCHEMA_NAME>

Prepare Elasticsearch

Close the Elasticsearch indexes:

    curl -XPOST 'http://<elastic host>:9200/mqm_<sp_logical_name>*/close'

For Windows, download curl for Windows.

Back to top

## Restore the shared space

To restore data backed up from a shared space you need to restore the space schema, restore the Elasticsearch snapshot, restore the ALM Octane repository, and activate the space.

Step 1: Restore the shared space schema

- For Oracle:

  1. Copy the dump file with space schema data to the new database server.

  2. Import the space schema data from backup using an Oracle utility.

  Example: impdp <admin conn> schemas=< SP_SCHEMA_NAME > dumpfile=<dumpfile> directory=<directory>

- For SQL Server, see Restore a Database Backup.

  Example: RESTORE DATABASE < SP_SCHEMA_NAME > FROM DISK = N'<Path to .bak file>' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5

Step 2: Restore the Elasticsearch snapshot

Follow this procedure from elastic.co.

Example:

curl -XPOST "http://<elastic host>:9200/_snapshot/<repository_name>/<snapshot_name>/_restore?pretty" -H 'Content-Type: application/json' -d'

{

"indices": " mqm_<sp_logical_name>*",

"ignore_unavailable": true,

"include_global_state": false

}

'

Step 3: Restore the ALM Octane repository

1. Go to the repo directory in your ALM Octane installation directory (default /opt/octane/repo/).

2. Locate the relevant subdirectory using this command: cd storage/sharedspaces/sp{SP_ID}

3. Delete all the contents of the directory before restoring: rm –fr *

4. Restore the zip file using this command: tar xvzf {BACKUP_DIR}/sp{SP_ID}.trz

5. For Windows use 7-Zip or another compression tool to restore the repository.

Step 4: Activate the space

1. After all preparations are finished and data is restored, restart the ALM Octane service. If there is more than one node of ALM Octane, restart each node.

2. After restart, activate the space:

   1. In site settings, access Site Admin > Spaces.

   2. Select your space (e.g., default_shared_space).

   3. Click Activate.

Back to top

See also:

- Manage space users
- Set up LDAP

https://admhelp.microfocus.com ALM Octane 8942
Tips to improve your search results... ValueEdge & ALM Octane Help Center ValueEdge ALM Octane Help 16.0.100-16.0.400 All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: