Restore SQL Server Database From Snapshot Backup

neil huang 0 Reputation points
2025-01-03T09:39:53.34+00:00

I am attempting some experiments related to restoring a database from a snapshot backup.

I backup metadata by T-SQL (BACKUP DATABASE with METADATA_ONLY) , and database mdf, ldf file by snapshot which involve SQL Server VSS Writer.

In the begining, i insert 10 data into database, and process first backup (backup 1).

When first backup finish, i insert 20 data into database, and process second backup (backup2)

After second backup finish, i insert 20 data into database, and backup transaction log

|----- (10 data)----[backup 1]-----(20 data)----[backup 2] ----(20 data)-----[transaction log backup]----|

I restore the database using metadata files and MDF/LDF files from different points in time.

Restore database with backup 1 metadata file and backup 2 mdf, ldf -> success, 30 data

Restore database with backup 2 metadata file and backup 1 mdf, ldf -> failed

Is it safe to restore the database using earlier metadata files with later MDF/LDF files from different points in time, or could this approach cause potential data leaks or restore failures in certain scenarios?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,374 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.