Databases 7 min read

How I Reclaimed 200 GB by Cleaning SQL Server Backups and Syncing Data

A developer discovers a nearly full 1 TB server disk caused by large SQL Server backup files, learns the backup strategy, removes old backups while keeping monthly snapshots, manually syncs production data to a test server, and reflects on backup file formats and storage optimization.

ITPUB
ITPUB
ITPUB
How I Reclaimed 200 GB by Cleaning SQL Server Backups and Syncing Data

Background

A remote server with a 1 TB disk showed less than 10 MB free space. Investigation identified SQL Server backup files as the primary consumer of storage.

Database Overview and Backup Policy

The environment hosts three databases (A, B, C). A daily backup runs at 23:05.

Backup file sizes (.bak): A ≈ 1.66 MB, B ≈ 120 MB, C ≈ 6.56 GB.

Data file sizes: A (mdf 50 MB, ldf 82.9 MB), B (mdf 2.07 GB, ldf 18.4 GB), C (mdf 42.8 GB, ldf 29.7 GB).

Resolving Disk‑Space Issue

Discovery: Recent backups for the large databases B and C were missing, likely because the disk ran out of space.

Action: Retained only one end‑of‑month backup per month from April 2022 to May 2023 and deleted the remaining daily backups. This reclaimed roughly 200 GB.

Verification: The next scheduled backup completed successfully for all three databases.

Manual Data Synchronization to a Test Server

When real‑time data is not required, a simple manual sync is used:

Copy the latest .bak backup from the production server to the test server.

Restore the backup on the test server using SQL Server Management Studio or RESTORE DATABASE commands.

Extended Learning

.bak vs. MDF+LDF

.bak files are backup‑only artifacts; they contain a compressed snapshot of the database at the time of backup. MDF (primary data file) and LDF (transaction log file) represent the live database and can also be used for backup, but they are not compressed.

Interpreting File Size Patterns

A large MDF relative to LDF suggests a high volume of stored data with relatively few transaction updates (e.g., Database C).

A large LDF relative to MDF indicates heavy transaction activity (e.g., Database B).

Additional Maintenance Options

Database shrink operations can reclaim unused space; see Microsoft’s “Shrink a Database” documentation for syntax and best practices.

For real‑time synchronization between production and test environments, consider SQL Server Replication or Always On Availability Groups, acknowledging the added complexity and performance impact.

Takeaways

In small teams, developers often perform database maintenance without a dedicated DBA, gaining broad operational experience.

Proactive monitoring of backup storage prevents unexpected disk‑space exhaustion.

Clear responsibility division and timely issue escalation improve both technical outcomes and team collaboration.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

data synchronizationDatabase BackupDBASQL Serverdisk space
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.