Sql-server – Copy database to a remote server on daily basis

backupshrinksql servert-sql

I need to replace the copy of my PROD db in a DEV system on a daily basis.

The problem is that I haven't enough space in my DEV system to restore the PROD db. Is there any way to create a shrinked .bak without make changes on original DB?

Thank you

Best Answer

I just want to avoid to spare disk space if possible. I'm searching for a way to "shrink on the fly" and then create the bak.. but seems to be impossible

Well, general answer here will be NO, there is no easy/simple way to get this done seeing the amount of free space , which is 50GB compared to the database (200GB) whose MDF is 80 GB.

Shrinking on FLY, No again. You have to shrink the file on prod before backing it up or later once restore (which is not the case here, as destination dev is only 50 GB).

It better to go for the option of more space , rather than going a very tedious and complex way ( will be OK, if we can be assured if it will work).

Also, refer to some suggestions/ answered at How to restore a SQL Server database and shrink its files at the same time?