SQL Server on Linux Series: Backing up over the network

Microsoft  ❤️  Linux
Microsoft ❤️ Linux
One of the challenges with any SQL Server business continuity strategy is backing up your databases and logs on a frequent basis. With Windows, we’ve known how to accomplish this for years. But, with SQL Server on Linux, you can accomplish the same task with just a few different twists. It is similar to mounting a network share as a new driver letter in Windows. Let’s explore how to back up your databases to a network share with Linux!

As of SQL Server 2017 RC2, we’ll want to accomplish it in a way that is transparent to SQL Server. (Depending on the RTM version whenever it is released, I might change the recommendation on this.) To do this, we’ll want to create a folder on the local file system that actually maps to a remote network share for SQL Server backups.

SSH into your server without elevated privileges at this point.

The network share is presented from a Windows server with the SMB protocol. Linux can connect to this using a compatible protocol called CIFS, or Common Internet File System. We’ll need to install the packages so we can natively connect. On Ubuntu and other Linux distros, the easiest is with the cifs-utils package. To install from the package manager is as simple as this.

SQL Server on Linux Series: Backing up over the network

My personal preference is to create a folder under the /mnt directory for this new mounted network share. I’ll be backing this up to a share for DB backups on my Synology NAS, so let’s call it syn1_dbbackup01. You’ll need elevated privileges to create this folder or you’ll get a permission denied error.

Continue reading on DavidKlee.net.

54321
(0 votes. Average 0 of 5)
Leave a reply

Your email address will not be published. Required fields are marked *