简体   繁体   中英

Transfer database data and schema only to different server

I have a rather large database (130+ tables) that needs to be transferred from a live server to a dev server quite often. Both servers are SQL Server Express (ver. 14).

  • Backup/restore doesn't work because it transfers data, schema and other objects (user privileges), but users on both servers are not the same

  • Tasks/Generate scripts... would produce very large .sql file (400MB+) and the SSMS (ver. 15) on the dev server runs out of memory (win10_64/32GB)??

  • I have a script that splits the database (on the live server) into several smaller databases, and then I can generate .sql scripts and transfer the data and schemas and combine them in the required database on the dev server. But, the problem is that I have to manually generate those scripts, and it's a time consuming task.

I was wondering if there is a more efficient solution to my problem?

Why not use Backup/Restore and then apply custom scripts to handle unwanted objects? Having the option to modify to the metadata objects(users..) would result in a security exposure/risk. More on that: https://dba.stackexchange.com/questions/71608/security-implications-of-restoring-a-backup-from-an-unknown-source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM