Make sure that no old TREX files exist in the directory into which you want to import the TREX installation. If necessary, delete old files. At file-system level, check the sr/sap/<SAPSID>/TRX<instance_number>/index and usr/sap/<SAPSID>/TRX<instance_number>/ queue directories to make sure that all entries really were deleted.
Execute the following scripts to set the environment variables required by TREX and the Python scripts:
UNIX:
Bourne shell sh, Bourne-again shell bash, Korn shell ksh:
. /usr/sap/<SAPSID>/TREX_<instance_number>/TREXSettings.sh
C shell csh:
source usr/sap/<SAPSID>/TRX<instance_number>/TREXSettings.csh
Windows: c: usr\sap\<SAPSID>\TRX<instance_number>\TREXSettings.bat
Navigate to the TREX directory that the Python script for importing indexes ( imxportManager.py) is located in: usr/sap/<SAPSID>/TRX<instance_number>/exe/python_support.
Restore the backed up indexes by executing the Python script for importing indexes using the following parameters:
python importManager.py
--indexId=<my_index_id> (mandatory)
--excludeIndexId=<my_index_id> (optional)
--importPath=<path_to_backup_directory> (optional)
--force=<0|1> (optional)
--useQueueServer=<0|1> (optional)
--verbose=<0|1> (optional)
--ignoreExportErrors=<0|1> (optional)
--testOnly=<0|1> (optional)
--updateExport=<0|1> (optional)
--directUse=<0|1> (optional)
--topologyPath=<path_to_the topology> (optional)
--importParts=<0|1> (optional; nur BIA)
--importSharedParts=<0|1> (optional; nur BIA)
--schemaOnly=<0|1> (optional; nur BIA)
Note that the --importParts=<0|1>, --importSharedParts=<0|1>, and --schemaOnly=<0|1> parameters are only significant for using the importManager.py Python script for the data backup and restore of OLAP and join indexes in the BI Accelerator (BIA). For more information, see Backing Up and Restoring BIA Data.
Explanations for the importManager.py Python script
Command |
Explanation |
--indexId=<my_index_id> (mandatory) |
You can specify that one or more indexes are to be restored. As <my_index_Id>, you must specify the index name, for example, first_index_name. To specify two or more indexes to be restored, use the following syntax: --indexId=index_1 --indexId=index_2 (and so on). If you want to restore all indexes, use the following syntax: --indexId=* |
--excludeIndexId= <my_index_id> (optional) |
You can specify that certain indexes are not to be imported. To import all indexes apart from index_1 and index_2, enter the following: --indexId=* --excludeIndexId=index_1 --excludeIndexId=index_2 |
--importPath= <path_to_backup_directory> (optional) |
Use the --importPath parameter to define the directory from which the indexes are to be imported. If you do not specify this value, the system imports the index from default backup directory / usr/sap/<SAPSID>/TRX<instance_number>/backup/index. Note that you must specify only the path itself without the directory name \index that the backed up index is located in as the path to the backup indexes (<path_to_backup_directory>). The --importPath parameter can contain the following special characters:
|
--force=<0|1> (optional) |
|
--useQueueServer=<0|1> (optional) |
|
--verbose=<0|1> (optional) |
|
--ignoreExportErrors=<0|1> (optional) |
Errors that occur during the export are logged in the exportStatus.log file.
|
--testOnly=<0|1> (optional) |
|
--updateExport=<0|1|2> (optional) |
To import and index, the system requires the two files called saved_configuration.cfg and SnapshotFiles.lst. These files are both generated during a normal export. However, if you want to import indexes that were not exported, these files are missing, and the import cannot take place. Use the --updateExport parameter to generate the two missing files. If the files are already available, they are overwritten.
|
--directUse=<0|1> (optional) |
The indexes loaded to TREX are normally located in a normal index directory (such as /usr/sap/<SAPSID>/TRX<instance_number>/index) that is created when the indexes are generated. However, the indexes to be imported are located in an export directory after the export. When an import takes place, the indexes are copied from the export directory into the actual index directory. Use the --directUse parameter to suppress this copying operation if required.
|
--topologyPath= <path_to_the topology> (optional) |
This parameter is only taken into account if the --updateExport=1 parameter is also set. As described above, if --updateExport=1, the system attempts to restore the two missing files saved_configuration.cfg and SnapshotFiles.lst. The topology.ini files can be used to generate the data required to generate these two files. If the topology.ini file is not available or is incomplete, default values are used for the missing files. |
--replicateIndexAfterImport= <0|1> (optional) |
|
-- help |
You can use the commend python --importManager.py --help to display more information on the script. |
In the case of a distributed TREX landscape, the script runs the replication of the indexes automatically on all hosts in a TREX landscape.
The backed up indexes have been restored in the TREX index directory.