Unable to restore backup to SQL Server

Unable to restore backup to SQL Server

Hello,

I'm currently running off of ServiceDesk Build 9000 with SQL Server 2012 installed separately on the network.

I created a backup using backUpData.bat on the ServiceDesk windows server and created a VM snapshot of the server.  I neglected to take a backup of the database on the SQL Server using SQl Server management studio (I wish I did.)

I performed a failed upgrade of ServiceDesk and then reverted back to the snapshot pre-patch which still contained the manual backup made using backUpData.bat.

I then deleted the upgraded database off of the SQL Server instance and re-created the ServiceDesk database using the "changeDBServer.bat" file and restarting the" ManageEngine ServiceDesk Plus" windows service.

At this point the ServiceDesk build installation was at 9000 and the backup file was again for build 9000:  "backup_mssql_9000_fullbackup_07_23_2014_11_34.data".

I then opened a command prompt using "Run As Administrator" and switched to the bin/ directory and executed the "restoreData.bat" file, pointied it to the full backup file noted above and let it run.

The restore fails.  Is there a resolution to this so I can restore the data using this method or is there a manual method that I can use to unzip the backup data and just run each backup script on the SQL Server to restore the data?

By all means, the build and the backup file are the same.  Why is the restore failing?

The restore output and error messages are as follows:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Administrator.JIBECONSULTING>cd \ManageEngine\ServiceDesk\bin

C:\ManageEngine\ServiceDesk\bin>restoreData.bat
********************************************************************************
*
                         Restore DB Setup Wizard
********************************************************************************
*

Execute Restore DB Utility from command prompt

        For Windows users :
                bin>restoreData -c [backup file]

        For Linux users :
                bin]#sh restoreData.sh -c [backup file]

********************************************************************************
*
Jul 24, 2014 12:50:12 PM com.adventnet.servicedesk.server.utils.SDDataManager setStandAlone
INFO: Going to set the standAlone param as : true
Jul 24, 2014 12:50:12 PM com.adventnet.servicedesk.server.utils.SDDataManager setStandAlone
INFO: Going to reset rootDir using server.dir
Jul 24, 2014 12:50:23 PM com.adventnet.servicedesk.server.utils.SDDataManager <init>
INFO: rootDir :: .
Jul 24, 2014 12:50:23 PM com.adventnet.servicedesk.server.utils.SDDataManager <init>
INFO: netutilsData :: {RELEASE={version=9.0}, BUILD={number=9000}}
Jul 24, 2014 12:50:23 PM com.adventnet.servicedesk.server.utils.SDDataManager <init>
INFO: rebrandData :: {OPMANAGER={name=OpManager}, PRODUCT={name=ManageEngine ServiceDesk Plus}, ADMANAGER={name=ADManager}}
You chose to open this file: C:\ManageEngine\ServiceDesk\backup\backup_mssql_9000_fullbackup_07_23_2014_11_34.data
File name is :  C:\ManageEngine\ServiceDesk\backup\backup_mssql_9000_fullbackup_07_23_2014_11_34.data
Jul 24, 2014 12:50:31 PM com.adventnet.servicedesk.server.utils.SDDataManager setStandAlone
INFO: Going to set the standAlone param as : true
Jul 24, 2014 12:50:31 PM com.adventnet.servicedesk.server.utils.SDDataManager setStandAlone
INFO: Going to reset rootDir using server.dir
Jul 24, 2014 12:50:31 PM com.adventnet.servicedesk.server.utils.SDDataManager <init>
INFO: rootDir :: .
Jul 24, 2014 12:50:31 PM com.adventnet.servicedesk.server.utils.SDDataManager <init>
INFO: netutilsData :: {RELEASE={version=9.0}, BUILD={number=9000}}
Jul 24, 2014 12:50:31 PM com.adventnet.servicedesk.server.utils.SDDataManager <init>
INFO: rebrandData :: {OPMANAGER={name=OpManager}, PRODUCT={name=ManageEngine ServiceDesk Plus}, ADMANAGER={name=ADManager}}
Extracting backup file....

Please wait extracting backup file

*************************************************************.\backup_info.xml
         Backpup data    : Wed Jul 23 11:34:36 PDT 2014
         Database name   : servicedesk
         Total Tables    : 1287
         Database Server : mssql
         Build Number    : 9000
*************************************************************

Jul 24, 2014 12:50:47 PM com.adventnet.updatemgr.util.ConfUtils changeDocType
INFO: Entering changeDocType
Jul 24, 2014 12:50:47 PM com.adventnet.updatemgr.util.ConfUtils changeDocType
INFO: publicChanged :: false
Jul 24, 2014 12:50:47 PM com.adventnet.updatemgr.util.ConfUtils changeDocType
INFO: written the file :: [server\default\conf\datasource-configuration.xml_tmp]
Jul 24, 2014 12:50:47 PM com.adventnet.updatemgr.util.ConfUtils changeDocType
INFO: Finally publicChanged :: false
Jul 24, 2014 12:50:47 PM com.adventnet.updatemgr.util.ConfUtils changeDocType
INFO: public ID not there in datasource-configuration.xml
Jul 24, 2014 12:50:47 PM com.adventnet.updatemgr.util.ConfUtils changeDocType
INFO: Exiting changeDocType
Jul 24, 2014 12:50:49 PM com.adventnet.updatemgr.util.ConfUtils parseXMLAndInstantiateDB
INFO: extractLocation : file:/C:/ManageEngine/ServiceDesk/applications/extracted/
Jul 24, 2014 12:50:49 PM com.adventnet.updatemgr.util.ConfUtils parseXMLAndInstantiateDB
INFO: startDBServer :: [true]
Jul 24, 2014 12:50:49 PM com.adventnet.updatemgr.util.ConfUtils parseXMLAndInstantiateDB
INFO: jndiName :: [MSSQLDS]
Jul 24, 2014 12:50:49 PM com.adventnet.updatemgr.util.ConfUtils parseXMLAndInstantiateDB
INFO: setdbhomearg set in mappings.xml :: [null]
Jul 24, 2014 12:50:49 PM com.adventnet.updatemgr.util.ConfUtils parseXMLAndInstantiateDB
INFO: Final setdbhomearg :: [false]
Jul 24, 2014 12:50:49 PM com.adventnet.updatemgr.util.ConfUtils parseXMLAndInstantiateDB
INFO: properties sent to adapter initialization :: {jndiname=MSSQLDS, name=mssql, setdbhomearg=false, sqlgenerator=com.adventnet.db.adapter.mssql.MssqlSQLGenerator}
Jul 24, 2014 12:50:49 PM com.adventnet.updatemgr.util.ConfUtils parseXMLAndInstantiateDB
INFO: db.home :: [C:\ManageEngine\ServiceDesk\bin\\..\pgsql] finally
Jul 24, 2014 12:50:49 PM com.adventnet.updatemgr.util.ConfUtils initDataAccess
INFO: connectionProperties :: [null]
Jul 24, 2014 12:50:49 PM com.adventnet.updatemgr.util.ConfUtils initDataAccess
INFO: url :: [jdbc:jtds:sqlserver://PRODMSSQL:1433;DatabaseName=servicedesk;Tds=8.0;PrepareSql=3;XaEmulation=false;]
Jul 24, 2014 12:50:49 PM com.adventnet.db.adapter.Jdbc20DBAdapter initialize
INFO: AUTO_QUOTE_IDENTIFIER value : false
Jul 24, 2014 12:50:49 PM com.adventnet.db.adapter.Jdbc20DBAdapter getListFromIdentifierFile
WARNING: AUTO_QUOTE_IDENTIFIERS not supported for this DB...
Error while trying to instantiate SQLGeneratir com.adventnet.db.adapter.mssql.MssqlSQLGenerator javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
Jul 24, 2014 12:50:49 PM com.adventnet.db.adapter.Jdbc20DBAdapter setUpDB
SEVERE: Start DBServer operation is not supported
Active DB Server = mssql
Database connectionProp : null
Error while trying to instantiate SQLGeneratir com.adventnet.db.adapter.SQLGenerator java.lang.InstantiationException: com.adventnet.db.adapter.SQLGenerator
Database started


Please wait ! Deleting table data in Progress..
0-----------------------50------------------------100(%)
=======================================================================
Error Tables : wordmap,wordoccurrences
0-----------------------50------------------------100(%)
QUERY = INSERT INTO DynamicTables (DYNAMIC_TABLE_ID,TABLENAME,MODULE,CHAR_COLS,NUM_COLS,DATE_COLS,DEC_COLS) VALUESnull
java.sql.BatchUpdateException: Invalid object name 'DynamicTables'.
        at net.sourceforge.jtds.jdbc.JtdsStatement.executeBatch(JtdsStatement.java:901)
        at com.adventnet.servicedesk.tools.RestoreSDBackup.restoreTableData(RestoreSDBackup.java:702)
        at com.adventnet.servicedesk.tools.RestoreSDBackup.dynamicTablesList(RestoreSDBackup.java:1274)
        at com.adventnet.servicedesk.tools.RestoreSDBackup.restoreDatabase(RestoreSDBackup.java:276)
        at com.adventnet.servicedesk.tools.RestoreSDBackup.main(RestoreSDBackup.java:141)
        at com.adventnet.servicedesk.tools.RestoreDialog$5.run(RestoreDialog.java:186)
        at java.lang.Thread.run(Unknown Source)
java.sql.BatchUpdateException: Invalid object name 'DynamicTables'.
        at net.sourceforge.jtds.jdbc.JtdsStatement.executeBatch(JtdsStatement.java:901)
        at com.adventnet.servicedesk.tools.RestoreSDBackup.restoreTableData(RestoreSDBackup.java:702)
        at com.adventnet.servicedesk.tools.RestoreSDBackup.dynamicTablesList(RestoreSDBackup.java:1274)
        at com.adventnet.servicedesk.tools.RestoreSDBackup.restoreDatabase(RestoreSDBackup.java:276)
        at com.adventnet.servicedesk.tools.RestoreSDBackup.main(RestoreSDBackup.java:141)
        at com.adventnet.servicedesk.tools.RestoreDialog$5.run(RestoreDialog.java:186)
        at java.lang.Thread.run(Unknown Source)
Unable to restore database : Invalid object name 'DynamicTables'.
Invalid object name 'DynamicTables'.

Jul 24, 2014 12:50:57 PM com.adventnet.updatemgr.util.ConfUtils stopDB
INFO: dbadapter :: [com.adventnet.db.adapter.mssql.MssqlDBAdapter@5eb9fde], startDBServer :: [true], dbProp :: {ManagedConnectionFactoryProperties=, TrackConnectionByTx=true, Password=Ez0lonaEG0zRoyU9BTf2, MaxSize=20, SecurityDomainJndiName=DBPwdEncrypt, UserName=sa, ConnectionURL=jdbc:jtds:sqlserver://PRODMSSQL:1433;DatabaseName=servicedesk;Tds=8.0;PrepareSql=3;XaEmulation=false;, BlockingTimeoutMillis=30000, Criteria=ByContainer, DriverClass=net.sourceforge.jtds.jdbc.Driver, JndiName=MSSQLDS, LocalTransactions=true, IdleTimeoutMinutes=15,MinSize=0}
Jul 24, 2014 12:50:57 PM com.adventnet.db.adapter.Jdbc20DBAdapter shutDownDBForceFully
SEVERE: Stop DBServer operation is not supported in Jdbc20DBAdapter
Jul 24, 2014 12:50:57 PM com.adventnet.updatemgr.util.ConfUtils stopDB
INFO: waitAfterDBStop :: val :: [5]
Jul 24, 2014 12:50:57 PM com.adventnet.updatemgr.util.ConfUtils stopDB
INFO: Thread is going to sleep for [5] seconds
Jul 24, 2014 12:51:02 PM com.adventnet.updatemgr.util.ConfUtils stopDB
INFO: Coming out of stopDB

C:\ManageEngine\ServiceDesk\bin>

Regards,

~Pete


                New to ADManager Plus?

                  New to ADSelfService Plus?