We have two virtual machines that one of them is live version of the system and one of them is the development environment. The problem is, when developers want to back up and restore the database from live machine to development machine, there are some sensitive data such as name, surname, father's name, date of birth, address etc. I don't want to backup user's sensitive data on certain table because of the GDPR.
So how can I backup and restore the database under this situation? Let's say the table name is Users. I just want to restore the all database apart from Users table's data. However, the developer accounts also store there, so I need to backup certain ids on Users table. I basically backup and restore the database through GUI on SQL Server Management Studio however I need to write some scripts for it.
BACKUP DATABASE [DB_NAME] TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\Backup\DB_NAME_Date.bak' WITH NOFORMAT, NOINIT, NAME = N'DB_NAME-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO