cancel
Showing results for 
Search instead for 
Did you mean: 

OpsCenter DBbackup problem after moving database

Pierre_J
Level 4

Hi all,

Yesterday we moved our OpsCenter database (running on Windows) to another disk device by changing the file C:\program Files\Symantec\OpsCenter\server\db\CONF\databases.conf, according to the Admin Manual.

All things work fine except for our dbbackup script:

E:\OpsCenterBackup>"C:\Program Files\Symantec\OpsCenter\server\bin\dbbackup.bat" E:\OpsCenterBackup
Backing up the OpsCenter database...
ERROR backing up the OpsCenter Database, Exiting...

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions

Mark_Solutions
Level 6
Partner Accredited Certified

Most of the script uses variables based on the location of the .bat file

You either need to edit it, move the .bat file to the other drive, or both

Quite possibly both as it creates its own variables based on where it is run from and then locates everything else based upon that but it may need more from the system itself than the database so more likely that you need to specify the database location and its backup location and leave it where it is

It is relatively clear where it gets everything from so shouldnt be too difficult to edit after being moved

View solution in original post

9 REPLIES 9

mph999
Level 6
Employee Accredited

Does the dbbackup.bat file contain the location of the DB ?

If so, try changing it to the new location ...

 

Martin

 

ps. copy the file first ....

Mark_Solutions
Level 6
Partner Accredited Certified

Most of the script uses variables based on the location of the .bat file

You either need to edit it, move the .bat file to the other drive, or both

Quite possibly both as it creates its own variables based on where it is run from and then locates everything else based upon that but it may need more from the system itself than the database so more likely that you need to specify the database location and its backup location and leave it where it is

It is relatively clear where it gets everything from so shouldnt be too difficult to edit after being moved

mph999
Level 6
Employee Accredited

Yep, think your right, the location of the actual DB is not in the file, I've just looked.

It does have this though ...

set SERVER_INSTALL_DIR=%SERVER_INSTALL_DIR:"=%

 

set /p OPSCENTER_DB_FILE=<"%SERVER_INSTALL_DIR%\db\conf\databases.conf
 
Being a unix chap, not sure how you go about this, any ideas Mark ?
 
M

Pierre_J
Level 4

I checked the dbbackup.bat file and it indeed uses many variables, but running the file from another location, as you suggested, generates another error which indicates that it is ment to ben run from the original location:

E:\OpsCenterBackup\Scripts>dbbackup.bat e:\opscenterbackup
'"E:\OpsCenterBackup\Scripts\\setEnv.bat"' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
"Could not find "=\config\db.conf file"

 

Pierre_J
Level 4

setenv.bat might be holding an interesting entry?

SET "DB_INSTALL_DIR=C:\PROGRA~1\Symantec\OPSCEN~1\server\db"
 

Since this dir is holding the data dir.

On the contrary, changing this makes the other subdirs in server\db inaccessible.

Mark_Solutions
Level 6
Partner Accredited Certified

That pretty much what i was saying - probably best to leave it where it was and edit the database location paths / varaiables

You will need to read through carefully to undertsand what it is doing and edit as appropriate

Pierre_J
Level 4

Mark, it is odd. Symantec supplies a well-designed product and offers the possiblity to move the database by doing a documented change : modify 1 variable in the ...server\db\CONF\databases.conf file.

If the dbbackup script had to be modified as well, I trust it would be documented as well.

And in dbbackup the conf-file is read:

set SERVER_INSTALL_DIR=%SERVER_INSTALL_DIR:"=%
set /p OPSCENTER_DB_FILE=<"%SERVER_INSTALL_DIR%\db\conf\databases.conf"


set temp=
for %%f in (%OPSCENTER_DB_FILE%) do (
set temp=!temp!%%~f
set temp=!temp!
)
set temp=%temp%
set "OPSCENTER_DB_FILE=%temp%"
if not exist "%OPSCENTER_DB_FILE%" (
 echo "%PRODUCT_NAME% database file %OPSCENTER_DB_FILE% does not exist"
 exit /b 6
)

Mark_Solutions
Level 6
Partner Accredited Certified

I agree with you - but can find no reference to the script needing changing after a database move - worth logging a call and getting them to do the work and clarify exactly which items need to be changed

I think it is straight forward but if it gets raised with Symantec they usually then add a tech note on what needs doing which will helpo others in the future

mph999
Level 6
Employee Accredited

Ahh, well spotted, that could well be it ...

I was close ...

 

M