Installation and Deployment > RDBMS Repository Installation Guide > HOPEX RDBMS repositories specific administration actions
HOPEX RDBMS repositories specific administration actions
Migrating Your Data from One Storage Support to Another
Previous versions of Hopex were compatible with GBMS (proprietary Mega data format), and Oracle. This section shows how to convert data from one of those to SQL Server.
General procedure:
1. Start HOPEX Administration.exe.
2. Connect to the environment containing the repositories to be migrated.
3. Expand the Repositories folder.
4. Right-click a repository and select Reorganize.
NB: Launch a complete environment migration starting with the data repositories and finishing with the SystemDb repository.
 
Graphical user interface, text, application Description automatically generated
To reorganize a repository:
1. Select the expected Target storage support.
Graphical user interface, text, application, email Description automatically generated
2. Click Apply to start the reorganization.
You are prompted to confirm or change the SQL Connection parameters.
The Test connection step must be successful for the process to continue.
The Test GRANTs step must be successful for the process to continue.
Note: To be successful, there should be no storage on the Sql Server concerning a HOPEX repository with the same name in a same HOPEX environment.
 
If your Sql Server User does not have the right to create databases, you need to ask your DBA to create an Sql Server database following the naming rule: <EnvironmentName>_<RepositoryName>. You should then choose the option “Use existing Sql Server Database”.
 
 
Results:
The database is now migrated to the SQL Server storage.
The .emq (SQL Server) file corresponding to the newly created repository storage is created.
The Megaenv.ini file is updated.
The logical backup file, used during the process, is stored in the 'work' folder of the source repository.
This backup is named according to the following format: Bkp_Date_BaseName.mgr .
Restoring a HOPEX environment from formatted data
In some cases, in HOPEX Administration, you need to recreate a repository from an existing set of data (a previously HOPEX formatted repository). For example, after a physical corruption (disk crash) of the machine hosting the HOPEX repository folder tree.
In such a situation, since the repository folder contains files indicating the way to reach the data and on which database server it can be found, the data could be considered lost from a HOPEX point of view.
It is necessary to understand that, from then on, HOPEX needs a new way to access the data inside the RDBMS. This is why this action is seen as a Restoration of the data: a re-creation of the repository folder structure allowing to re-save the way to access the data.
This method can also be used for duplicating an environment from a production infrastructure to a test infrastructure (or vice versa). For doing so, all the repositories (including the SystemDb) must be duplicated first in the RDBMS. The restoration can then be done on the duplicates repositories, starting with the SystemDb.
Restoring an environment (SystemDb repository)
1. Start HOPEX Administration.exe.
2. Right-click the Environments folder and select New.
Graphical user interface, text, application Description automatically generated
3. In Name, enter the name of the environment that is to be restored (the exact same name as the one used for the first creation).
4. Select Restore.
Graphical user interface, text, application, email Description automatically generated
5. Click OK.
6. Specify the connection parameters for accessing the RDBMS where the HOPEX -yet-unreachable data is located.
7. Click Test Connection.
The test must be successful for the process to continue.
8. Click Test GRANTs.
The test must be successful for the process to continue.
9. Click OK.
The SystemDb repository is restored.
Once these actions are performed successfully, there are a few more actions to perform to be able to restore the repositories that were referenced into the newly restored environment.
At this point, if you open the environment that was just restored, you will see the following warning message: “The <repository name> is not referenced”).
The reason is that the environment that was just restored has “a knowledge” of the repositories that should be referenced in it but the references for those repositories do not yet exist in the folder tree structure of the newly restored environment.
To be able to re-reference the required repositories by restoration in this environment, you must first purge that “knowledge”:
1. Right-click the Environment and select Remove not referenced repositories:
Graphical user interface, text, application, email Description automatically generated
 
Important notes
 
DO NOT use Remove not referenced repositories if the environment is in use somewhere else as it will delete the references to the repositories there too !
Use it only on an environment that is a physical copy on the RDBMS storage side.
Be carefull that the repositories also must be restored from a physical RDBMS copy (see next chapter for repositories restoration).
 
Not taking care of this will lead to situations where users might think that they are using different sets of data when they are actually using and modifying the same repositories !
Restoring a data repository
Note: A repository can only be restored within an environment that has the same name as the one in which the repository was originally created. An environment with the same name can be recreated before restoring the repository in it or the actual environment can be restored beforehand.
To restore a data repository:
1. Start HOPEX Administration.exe.
2. Connect to the environment in which you want to restore the repository.
3. Right-click the Repositories folder and select New.
4. In Name, enter the name of the repository that is to be restored (the exact same name as the one used for the first creation).
5. Select Restore from an SQL backup.
6. Keep the Import module standard data option selected.
This option enables to import the .xmg files of the modules already deployed on the HAS instance.
Note: If you restore several repositories, clear the Import module standard data option and once all of your repositories are restored launch the Environment Automatic Update. Else, keep the option selected for the last repository restoration only.
Graphical user interface, text, application, email Description automatically generated
7. Click OK.
8. Specify the connection parameters for accessing the RDBMS where the HOPEX -yet-unreachable data is located.
NB: the “Creation Mode” parameter is disable (the choice is not possible) when “Restore from an SQL backup” is selected. As in this case, HOPEX is actually told to re-attach to physical data so no database creation or repository initialization will be carried out.
9. Click Test Connection.
The test must be successful for the process to continue.
10. Click Test GRANTs.
The test must be successful for the process to continue.
11. Click OK.
The repository is restored.
Handling of HOPEX RDBMS repositories specific internal format
There is an internal format used by HOPEX when accessing a repository that is stored on SQL Server.
To view this internal format version:
1. Start HOPEX Administration.exe.
2. Right-click the HOPEX repository (either SystemDb or data repository) and select Properties.
Graphical user interface, text, application Description automatically generated
A screenshot of a computer Description automatically generated
When upgrading your HOPEX installation (applying a Cumulative Patch or migrating your data from a HOPEX SP version to the next one), there might be some modifications leading to a new internal format version.
From Mega 2009 SP5, new menus are available to manually activate this internal format upgrade.
Note: Before Mega 2009 SP5, the upgrade was made “on the fly” when first accessing the Mega repository with a Mega program corresponding to a more recent internal format version.
When you need to upgrade the internal format version, you are prompted to do it with the following window:
Note: The technical conversion of the repositories of the environment must be done before upgrading to the environment:
1. Apply the technical conversion on the SystemDb:
Right-click the environment and select Perform SQL conversion on the repository.
Graphical user interface, text, application, email Description automatically generated
2. Apply the technical conversion on the other data repositories of the environment:
For each repository, right-click the repository and select RDBMS Administration > Perform SQL conversion on the repository.