Upgrades - how to backup and restore user data - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

jvariano
Posts: 1
Joined: Sun Dec 04, 2011 11:23 pm

Upgrades - how to backup and restore user data

Hello,

I need to create a project that can be used for installs and upgrades. When the user is upgrading, the old database needs to be backed up prior to uninstall. After install, the data needs to be imported into the new database.

I'm on Advanced Installer "Professional". I built a Visual Studio project connected to a SQL Server Express database with about 35 tables. The .mdf and the .ldf database files are located in the Application folder with the rest of the files. This works fine the first time a user installs my software. But what about upgrades? The user's data will be lost because the old database files will be uninstalled.

Should I build a custom action and use SQL Script to accomplish this? Should I build a function into my application that performs this task? What is the best practice? I've been searching for information on this topic but I haven't found much in the documentation.

Thanks!
Jason
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Upgrades - how to backup and restore user data

Hi Jason and welcome to Advanced Installer forums,

If you need to prevent the database files from being replaced by a newer version here's an article to guide you.

You can also try the Persistent User Data wizard from the menu bar -> Wizards -> Resources. This wizard will allow you to specify which files will be preserved in an upgrade or repair operation.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”