DB Snapshots¶
A DB snapshot is a SQL Server database snapshot of an instance’s database, taken right after the database has been created during the installation. With Rollback to snapshot you can return the database to this clean, just-installed state at any time, for example after a test run or a failed data import, without reinstalling the instance.
Snapshot Requirements¶
SQL Server Developer, Standard or Enterprise edition. SQL Server Express does not support database snapshots. If the selected database server is an Express edition, the option is disabled with the hint Database snapshots are not supported on SQL Server Express.
PostgreSQL databases are not supported.
The snapshot can only be taken during the installation. Instances installed without it cannot get a snapshot later.
Take a snapshot during installation¶
Open the installation form for Haufe X360 (Install Haufe X360 Application) or Acumatica (Install Acumatica Application).
Select Take a DB snapshot after install.
Fill in the rest of the form and click Install.
The installation then runs the extra step Create Database Snapshot right after the database has been created (or, for an installation with demo data, right after the demo data has been restored), before the IIS site is created. If a later step of the installation fails, the snapshot of the clean database is still there.
The snapshot is named <instance>_post_install. Its sparse files (<instance>_post_install_<logical file name>.ss) are
stored in the same folder as the data files of the database, usually the default data folder of SQL Server. There is one snapshot
per instance.
Roll back to the snapshot¶
Go to the Applications screen.
Open the Actions menu of the instance and click Rollback to snapshot.
For instances without a snapshot the action is disabled with the hint No database snapshot is available for this instance.
The rollback runs as a task in these steps:
Stop the application pool of the instance.
Delete any other snapshots of the database (SQL Server only restores from a snapshot if it is the only one).
Close all open connections to the database.
Restore the database from the snapshot.
Start the application pool again.
The snapshot itself stays after a rollback, so you can roll back again as often as you need.
Snapshots and other instance operations¶
Clone: When you clone an instance that has a snapshot, a new snapshot
<clone>_post_installis taken of the cloned database. Rolling back the clone returns it to the state it had when it was cloned, not to the state after the installation of the original instance. Clones of instances without a snapshot get none.Update: The snapshot always holds the database as it was right after the installation. An update does not take a new snapshot. Rolling back an updated instance returns the database to the version it was installed with, while the application files stay on the new version. Do not roll back after an update; reinstall the instance instead.