Corey
Posts: 13
Joined: Tue Mar 25, 2014 4:54 am

Restore DB via sqlcmd

Hi,
I am trying to follow the advice in this thread

http://www.advancedinstaller.com/forums ... f=2&t=2207

However I keep receiving the following error in event viewer
"Action LaunchExeWith Directory, Location C:\inetpub\wwwroot\, command "[PathToSQLCMD]"sqlcmd.exe -S .\[InstanceName -U [User] -P [Pass] -v FilePath = "C:\Myback.bak" -i RestoredDB.sql

All options are filled correctly in the event log, is there any way to trace this back further? I run this command from the command line with no issues and it restores the DB
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Restore DB via sqlcmd

Hi,

I'm not sure why you encounter this problem. Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com, so we can investigate them?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Corey
Posts: 13
Joined: Tue Mar 25, 2014 4:54 am

Re: Restore DB via sqlcmd

Thank you, I have sent the requested items
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Restore DB via sqlcmd

Hi,

I looked over the files that you sent and I noticed that your custom action was not configured correctly. For example, in the "File Path" filed you should write the full path to the "sqlcmd.exe" file, not just the path to its parent folder. Also, you should write the full path (or its related property) to the "RestoreDB.sql" file, not only its name.

An example of how you should configure your custom action is written below:
  • File Path: [ProgramFilesFolder]\Microsoft SQL Server\110\Tools\Binn\sqlcmd.exe
    Command Line: -S .\CAAB -U [SQL_USERNAME] -P [SQL_PASSWORD] -v FilePath ="[DB_DIR]" -i [#RestoreDB.sql]
    Working Directory: IIsWWWRootFolder
    Check the When the system is being modified (deferred) option
    Check the Run under the LocalSystem account with full privileges (no impersonation) option
    Check when you want this custom action to be executed (i.e. Install, Maintenance)
Can you make the above configurations and see if it works?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”