How can I backup a remote SQL Server database to a local drive?

前端 未结 23 1293
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 16:20

I need to copy a database from a remote server to a local one. I tried to use SQL Server Management Studio, but it only backs up to a drive on the remote server.

Som

相关标签:
23条回答
  • 2020-11-30 17:18

    I could do that once...TO do this you have to have a share opened on the remote server. then you can directly place the backup on the share itself, than the default location...

    Usually the admin takes the backup and shares it with us in some shared folder. I tried if that will work if i place the backup there. It worked.

    0 讨论(0)
  • 2020-11-30 17:19

    For 2019, I would recommend using mssql-scripter if you want an actual local backup. Yes it's scripts but you can adjust it to include whatever you want, which can include all of the data. I wrote a bash script to do automated daily backups using this on a linux machine. Checkout my gist:

    https://gist.github.com/tjmoses/45ee6b3046be280c9daa23b0f610f407
    
    0 讨论(0)
  • 2020-11-30 17:22

    I'm astonished that no-one has mentioned the scripted backup solution offered by Ola Hallengren which absolutely does allow you to backup a DB from a remote server to a UNC path on your network for free (I'm actually using it as I type to backup a DB from a dev server to which I have no remote access other than through SSMS to a share on my dev PC). This has been available since 2008 and works on SQL Server 2005 through to 2014.

    You need to ensure that the share you set up has enough access: I tend to allow full read/write to the 'Everyone' AD group for the duration of the backup process because I'm too lazy to figure out anything more restrictive but that's personal choice.

    It's well-used, well-documented and very flexible. I tend to put the procs and the logging table in their own little utility database and then fire it up. Provided everything is in your AD domain and not remote in the sense that it's out on a co-located server or something, this works very well.

    Apologies for adding to a very old thread but I came across this when looking for something else and figured it was a worthwhile addition for anyone looking for this topic.

    0 讨论(0)
  • 2020-11-30 17:23

    You can use Copy database ... right click on the remote database ... select tasks and use copy database ... it will asks you about source server and destination server . that your source is the remote and destination is your local instance of sql server.

    it's that easy

    0 讨论(0)
  • 2020-11-30 17:23

    Create a local shared folder, with "everyone" read/write privileges

    Connect to the target database, start the backup and point to the share like below

    \mymachine\shared_folder\mybackup.bak

    (Tried on Windows domain environment)

    0 讨论(0)
提交回复
热议问题