December 11, 2016 at 2:46 pm
Hello Experts,
I need to copy backup files from Prod server to Non Prod server but the problem is both are in two different domains and SQL Service Agent Service accounts do not have permissions to copy the files. Prod bkp files are stored in the storage server which is in Prod domain.
Any suggestion how to copy the Prod bkp files to Non Prod server so that I can automate the Restore DB process?
Thanks.
December 11, 2016 at 9:32 pm
This was removed by the editor as SPAM
December 11, 2016 at 10:42 pm
If you were going to automate this, wouldn't it require at least a one-way trust between the two domains? SneakerNet isn't really automation...
December 11, 2016 at 10:55 pm
pietlinden (12/11/2016)
If you were going to automate this, wouldn't it require at least a one-way trust between the two domains? SneakerNet isn't really automation...
Especially offline SneakerNet.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 12, 2016 at 2:15 am
I need to copy backup files from
JasonClark (12/11/2016)
Make database off line.Detach the production database
????
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 12, 2016 at 2:36 am
If you don't have a trust relationship between the domains, then you'll need to somehow embed a password for the non prod domain into whatever process does the work. Maybe you could use FTP? Failing that, you're back to SneakerNet. I had never heard that term before!
John
December 12, 2016 at 2:55 am
GilaMonster (12/12/2016)
I need to copy backup files from
JasonClark (12/11/2016)
Make database off line.Detach the production database
????
I was just coming to post that. It made my blood run cold.
December 12, 2016 at 8:01 am
If you want to automate this process the best way is to configure trust between domains. If you nedd to do this operation once, you can use local account on non prod server to copy files. Just type \\<remoteservername.domain>\<sharename>\ in explorer and then use local credentials (in domainprefix\username format) to authenticate.
December 12, 2016 at 9:13 am
I have a similar problem in getting backups off a production server in a timely manner.
(I also have to encrpyt them with 7-Zip as it only runs standard edition.)
Running a powershell job step to use RoboCopy as the last step of the backup agent jobs seems to work.
Something like:
$Share = 'remoteserver\sharename'
$ShareUsr = 'remoteserver\userWithWriteRightsToShare'
$SharePwd = 'UserPwd'
$Source = 'SourcePath'
$net = new-object -ComObject WScript.Network
If (!(Test-Path "B:"))
{
$net.MapNetworkDrive("B:", "$Share", $false, "$ShareUsr", "$SharePwd")
}
robocopy $Source "B:\" *.7z /S /R:0 /W:0 /NFL /NDL /NJH /NJS
$net.RemoveNetworkDrive("B:", $true)
A bit of a hack but there are extenuating circumstances.
December 12, 2016 at 9:45 am
Hi Ken
Thanks for sharing the script.
The prod backup goes to a NAS shared location which is in Prod domain. The Non Prod servers are in TEST domain. Both the servers as being in different domains, do not talk to each other.
To use the script, should I create a Proxy and give full permission to Powershell and run the script from NON PROd under a SQL agent job? Or what do you suggest.
Thanks.
December 12, 2016 at 10:04 am
SQL-DBA-01 (12/12/2016)
Both the servers as being in different domains, do not talk to each other.
In my case I can login to the remote server using a local user on that server. ie I do not need to bother with a poxy. You will have to play around to see what works for you,
I have just noticed you want to automate a restore process on a DEV box. In this case it might be better to attach to the production box from DEV so the whole process can be run from a job on DEV at a time you know the backups are available.
December 12, 2016 at 10:08 am
Only the bar here for me is that, I need to copy the backup from the remote NAS share server which is in PROD domain to the NON PRod server location and the remaining restore part I can handle easily with post restore steps.
Thanks.
December 12, 2016 at 12:26 pm
I think there are far too many complex solutions to a relatively simple Problem here.
Why not simply create a COPY_ONLY backup on the prod System and ROBOCOPY it to the non-prod location?
December 14, 2016 at 3:43 am
We looked at Robocopy and Powershell here and tried various implementations but found them not totally 100% reliable and secure.
In the end we went with a third party product called SyncBackPro and used the Secure FTP feature to do the transfer across domains.
We found that method very reliable and very automatic.
YMMV.
Regards, Dave.
December 14, 2016 at 4:36 am
dave hants (12/14/2016)
We looked at Robocopy and Powershell here and tried various implementations but found them not totally 100% reliable and secure.In the end we went with a third party product called SyncBackPro and used the Secure FTP feature to do the transfer across domains.
We found that method very reliable and very automatic.
YMMV.
Regards, Dave.
What works for one doesn't necessarily work for another I guess.....
Viewing 15 posts - 1 through 15 (of 19 total)
You must be logged in to reply to this topic. Login to reply