Avatar of yadavdep
yadavdep
Flag for India asked on

Transfer SQL Server 2012 database over to other SQL Server 2012 with automation

We have one condition, that we need to transfer one SQL Server Database (using backup if possible)  to another SQL Server
But We are trying to do this without manual work.
Till now what we used to do is Take backup from Source Server and upload it to the destination server using an  C# windows application and FTP.

But our client is not in favor of using FTP.

So we are looking for some other option, which we can code if needed to get automation and transfer the database between two servers.




DatabasesMicrosoft SQL Server

Avatar of undefined
Last Comment
ste5an

8/22/2022 - Mon
Arifhusen Ansari

Are both servers on same network ??

yadavdep

ASKER
No, they both are different server 
Andrei Fomitchev

In what way you are going to deliver data?
Backup - transfer - restore is a good way. If FTP cannot be used for transfer then you can copy backup files to some media (memory stick, HD, Burn DVD), deliver media, and restore backup.

Instead of backup you can detach DB, copy DB files, reattach DB back, transfer DB copy and attach it.

If you use compressed backup then it works quicker, backups are 8-10 times smaller.

If you can connect to destination with SSMS from your location you can also use Generate Script in SSMS:

 In options choose to include data. It will generate a text file with CREATE/INSERT. Then you
1. Connect to destination
2. Execute generated code by ~1000 rows, for example - part-by-part.

But if the volume of DB is large I would prefer backup/recovery or detach/attach.

Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
ste5an

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.