Highlighted
Contributor.
Contributor.
306 views

Failed to Restore Project when Restoring the Project Using SA API

Hi Team ,

We have recently upgraded to  HP ALM 12.01 and now we are  migrating our ALM Database Server, Since we have more than 300 ALM Projects, we are trying to automate the 'Restore Project' action via SA API

 

However, we are reciving the following error message:

 

"Failed to restore the Project"

 

We have modified and used the following code 

 

 Dim sDomainName As String
    Dim sProjectName As String
    Dim sServerName As String
    Dim CreateOptions As Long
    Dim sReply As String

    On Error GoTo err
    sDomainName = "MyDomain"
    sProjectName = "MyProject"
    sServerName = <ALM 12.01 URL>

    sReply = m_SAClient.RestoreProject( _
        sDomainName, sProjectName, SA_MSSQL_DB_TYPE , _
        <Project Repository>, sProjectName, _
        sServerName, <JDBC Connection Sring>, _
        sUserPassWord, True, True, True, 20, "", _
        "New Project1 for testing")
       
    MsgBox sReply
    Exit Sub
err:
    MsgBox "Program failed:" + err.Description
End Sub

 

Please let us know if any parameters has to be added or if there are any utilites available to automate the restoration process

 

Note:

We do not want to upgrade the project

Project restoration works when done manually

0 Likes
4 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Have you reviewed the SA log files to see if additional details are available?

[If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

(Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted.)
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

@Roddy /@

 
 
 
 
 
 

2020-09-17 14_06_41-Window.png

 

Tags (1)
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

In the example, it wrongly uses variable "sProjectName" and "sServerName" to stand for DB name and DB Server parameter. Correct it may help you.
BTW, it is better to use RestoreProjectEx2 which supports smart repository parameter.
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

@Roddy what is different between RestoreProjectEx2 and RestoreProject? 

Im confused in the sample code and the info you please give me above. Can you give me a clean working code please?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.