kahmad
Posts: 9
Joined: Thu Jun 27, 2013 11:47 pm

How to perform SQL Server database restore

I have created a custom feature selection dialog with checkboxes using these instructions: http://www.advancedinstaller.com/user-g ... ature.html. One of the optional features listed on this dialog is a SQL Server database restore. When this feature is checked I would like to take an existing database backup file and perform the restore. How do I go about doing that?

Your help is greatly appreciated!
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: How to perform SQL Server database restore

Hello,

If you are using a SQL Script or a Custom Action to perform the restore operation, then you can condition its execution using the property of the check box control associated with your SQL Server database restore option.

Also, if your restore database file is added in the “Files and Folders” page, then you can simply move its component (from "Organization" page) under the feature which is installed only if the checkBox is selected.

Let us know if that helped otherwise give us more details.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kahmad
Posts: 9
Joined: Thu Jun 27, 2013 11:47 pm

Re: How to perform SQL Server database restore

Thank you for responding to my question! I have the database backup file which I can add to the "Files and Folders" page and place under the appropriate feature on the Organization page. I will also be adding a custom dialog to the sequence to prompt the user for the necessary database connection information. It seems like I have all the pieces that I need. But I don't know how to actually perform the database restore. Can you provide additional information?

Thanks!
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: How to perform SQL Server database restore

Hello,

In order to achieve that you can take a look on SQL Scripts - Database Restoration which debates a similar subject.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”