Note: this article is published on 03/14/2023.
This series of articles is about Docker, or Container, due to I cannot get the suitable category, so I designate it to DevOps because the container is used for CI/CD (Continuous Integration and Continue Deployment).
Container (3), Installing SQL Server into Docker
Container (3-1), Get the Backup File into Container --- this article
A - Introduction
After we install the SQL Server database into a container, we usually need to import a database into the SQL Server. However, the Container is running under a Linux system, moving data from Windows System into a Linux system is not automatic and even not an easy task. This article will discuss this issue. Contents of this article:
A - Introduction
B - What is the Problem
C - Where is the Problem
D - How to Solve the Problem
E - Implementation
B - What is the Problem
After we install the SQL Server database into a container, we can open the database through SSMS. At this point, we need to get a database either from backup/restore or export/import. Now assume we have a backup database and need to restore into the SQL Server in Container:
Open SSMS, Choose database => Restore Database.

Choose Device => add (backup media):

We get the screen: Locate Backup File:

However, the opened file system from SQL Server in Docker Container is a Linux system, not Windows File System.
C - Where is the Problem
This article, MS SQL Server Docker data location - Stack Overflow, give the location

The location for backup files are stored in Linux File System at
/var/opt/msswl/dataThis is exactly what we got from the screenshot above.
Note, we can get similar info from this article: Configure SQL Server settings on Linux - SQL Server | Microsoft Learn
D - How to Solve the Problem
This article, Restore a SQL Server database in a Linux container - SQL Server | Microsoft Learn. give the solution:






Join the conversation! Your thoughts help the community grow.