SQL Server on linux unable to export to bacpac












2















I'm trying to export my database to a .bacpac file. I get the following error:



(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


The command I'm using is:



/opt/mssql/bin/sqlpackage /action:Export /SourceServerName:localhost /SourceDatabaseName:MyDB /targetfile:'/media/jake/1F171B4C75D06418/MyDB.bacpac'


The database I'm trying to back up is on a different ssd than my mssql installation. I don't know if that makes a difference.



I've been googling around for how to fix this and most people using windows had their similar problem solved by making sure that various windows services were running and starting them if they weren't. But I'm not sure how to check for the same thing in linux, but I think all the services I need are currently running because I can connect to the database via sqlcmd as well as through JetBrains' DataGrip application. So I know that a connection is possible. I just don't know why sqlpackage is having trouble connecting...



I've also tried variations of this command on the SourceServerName parameter:



/opt/mssql/bin/sqlpackage /action:Export /SourceServerName:tcp:localhost,1433 /SourceDatabaseName:MyDB /targetfile:'/media/jake/1F171B4C75D06418/MyDB.bacpac'


And the error is slightly different:



(provider: TCP Provider, error: 0 - No such host is known.)









share|improve this question














bumped to the homepage by Community 17 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    2















    I'm trying to export my database to a .bacpac file. I get the following error:



    (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


    The command I'm using is:



    /opt/mssql/bin/sqlpackage /action:Export /SourceServerName:localhost /SourceDatabaseName:MyDB /targetfile:'/media/jake/1F171B4C75D06418/MyDB.bacpac'


    The database I'm trying to back up is on a different ssd than my mssql installation. I don't know if that makes a difference.



    I've been googling around for how to fix this and most people using windows had their similar problem solved by making sure that various windows services were running and starting them if they weren't. But I'm not sure how to check for the same thing in linux, but I think all the services I need are currently running because I can connect to the database via sqlcmd as well as through JetBrains' DataGrip application. So I know that a connection is possible. I just don't know why sqlpackage is having trouble connecting...



    I've also tried variations of this command on the SourceServerName parameter:



    /opt/mssql/bin/sqlpackage /action:Export /SourceServerName:tcp:localhost,1433 /SourceDatabaseName:MyDB /targetfile:'/media/jake/1F171B4C75D06418/MyDB.bacpac'


    And the error is slightly different:



    (provider: TCP Provider, error: 0 - No such host is known.)









    share|improve this question














    bumped to the homepage by Community 17 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      2












      2








      2








      I'm trying to export my database to a .bacpac file. I get the following error:



      (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


      The command I'm using is:



      /opt/mssql/bin/sqlpackage /action:Export /SourceServerName:localhost /SourceDatabaseName:MyDB /targetfile:'/media/jake/1F171B4C75D06418/MyDB.bacpac'


      The database I'm trying to back up is on a different ssd than my mssql installation. I don't know if that makes a difference.



      I've been googling around for how to fix this and most people using windows had their similar problem solved by making sure that various windows services were running and starting them if they weren't. But I'm not sure how to check for the same thing in linux, but I think all the services I need are currently running because I can connect to the database via sqlcmd as well as through JetBrains' DataGrip application. So I know that a connection is possible. I just don't know why sqlpackage is having trouble connecting...



      I've also tried variations of this command on the SourceServerName parameter:



      /opt/mssql/bin/sqlpackage /action:Export /SourceServerName:tcp:localhost,1433 /SourceDatabaseName:MyDB /targetfile:'/media/jake/1F171B4C75D06418/MyDB.bacpac'


      And the error is slightly different:



      (provider: TCP Provider, error: 0 - No such host is known.)









      share|improve this question














      I'm trying to export my database to a .bacpac file. I get the following error:



      (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)


      The command I'm using is:



      /opt/mssql/bin/sqlpackage /action:Export /SourceServerName:localhost /SourceDatabaseName:MyDB /targetfile:'/media/jake/1F171B4C75D06418/MyDB.bacpac'


      The database I'm trying to back up is on a different ssd than my mssql installation. I don't know if that makes a difference.



      I've been googling around for how to fix this and most people using windows had their similar problem solved by making sure that various windows services were running and starting them if they weren't. But I'm not sure how to check for the same thing in linux, but I think all the services I need are currently running because I can connect to the database via sqlcmd as well as through JetBrains' DataGrip application. So I know that a connection is possible. I just don't know why sqlpackage is having trouble connecting...



      I've also tried variations of this command on the SourceServerName parameter:



      /opt/mssql/bin/sqlpackage /action:Export /SourceServerName:tcp:localhost,1433 /SourceDatabaseName:MyDB /targetfile:'/media/jake/1F171B4C75D06418/MyDB.bacpac'


      And the error is slightly different:



      (provider: TCP Provider, error: 0 - No such host is known.)






      sql-server linux bacpac






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 1 '17 at 19:42









      Jake SmithJake Smith

      1113




      1113





      bumped to the homepage by Community 17 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 17 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          According to the official documentation for SqlPackage on 2017 CTP 2.1, the command to export data and schema is as follows:



          /opt/mssql/bin/sqlpackage /a:Export /ssn:tcp:<your_server> /sdn:<your_database> /su:<username> /sp:<password> /tf:</path/to/your/file.bacpac>


          Looking at your command, it appears you're missing credentials, so I'd give this a try (I've shortened the other parameters as well, and removed the TCP port):



          /opt/mssql/bin/sqlpackage /a:Export /ssn:tcp:localhost /sdn:MyDB /su:<user> /sp:<password> /tf:'/media/jake/1F171B4C75D06418/MyDB.bacpac'





          share|improve this answer
























          • Does the same error occur using SELECT statements inside SSMS, or sqlcmd?

            – Randolph West
            Jul 2 '17 at 19:14













          • sqlcmd yes, SSMS yes (through windows vm). I've since taken that other ssd and just installed windows on it and started this whole process over. If I use SSMS to restore the bak file, I don't have any corruption like I did on the linux side.

            – Jake Smith
            Jul 3 '17 at 19:21











          • Interesting. Do you have any thoughts as to what caused the corruption?

            – Randolph West
            Jul 3 '17 at 19:22











          • My only guess is that I was restoring something too old to be compatible with SQL server on Linux. No errors during restoration, but reads past a few thousand records would error out 😖

            – Jake Smith
            Jul 3 '17 at 19:58











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f177774%2fsql-server-on-linux-unable-to-export-to-bacpac%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          According to the official documentation for SqlPackage on 2017 CTP 2.1, the command to export data and schema is as follows:



          /opt/mssql/bin/sqlpackage /a:Export /ssn:tcp:<your_server> /sdn:<your_database> /su:<username> /sp:<password> /tf:</path/to/your/file.bacpac>


          Looking at your command, it appears you're missing credentials, so I'd give this a try (I've shortened the other parameters as well, and removed the TCP port):



          /opt/mssql/bin/sqlpackage /a:Export /ssn:tcp:localhost /sdn:MyDB /su:<user> /sp:<password> /tf:'/media/jake/1F171B4C75D06418/MyDB.bacpac'





          share|improve this answer
























          • Does the same error occur using SELECT statements inside SSMS, or sqlcmd?

            – Randolph West
            Jul 2 '17 at 19:14













          • sqlcmd yes, SSMS yes (through windows vm). I've since taken that other ssd and just installed windows on it and started this whole process over. If I use SSMS to restore the bak file, I don't have any corruption like I did on the linux side.

            – Jake Smith
            Jul 3 '17 at 19:21











          • Interesting. Do you have any thoughts as to what caused the corruption?

            – Randolph West
            Jul 3 '17 at 19:22











          • My only guess is that I was restoring something too old to be compatible with SQL server on Linux. No errors during restoration, but reads past a few thousand records would error out 😖

            – Jake Smith
            Jul 3 '17 at 19:58
















          0














          According to the official documentation for SqlPackage on 2017 CTP 2.1, the command to export data and schema is as follows:



          /opt/mssql/bin/sqlpackage /a:Export /ssn:tcp:<your_server> /sdn:<your_database> /su:<username> /sp:<password> /tf:</path/to/your/file.bacpac>


          Looking at your command, it appears you're missing credentials, so I'd give this a try (I've shortened the other parameters as well, and removed the TCP port):



          /opt/mssql/bin/sqlpackage /a:Export /ssn:tcp:localhost /sdn:MyDB /su:<user> /sp:<password> /tf:'/media/jake/1F171B4C75D06418/MyDB.bacpac'





          share|improve this answer
























          • Does the same error occur using SELECT statements inside SSMS, or sqlcmd?

            – Randolph West
            Jul 2 '17 at 19:14













          • sqlcmd yes, SSMS yes (through windows vm). I've since taken that other ssd and just installed windows on it and started this whole process over. If I use SSMS to restore the bak file, I don't have any corruption like I did on the linux side.

            – Jake Smith
            Jul 3 '17 at 19:21











          • Interesting. Do you have any thoughts as to what caused the corruption?

            – Randolph West
            Jul 3 '17 at 19:22











          • My only guess is that I was restoring something too old to be compatible with SQL server on Linux. No errors during restoration, but reads past a few thousand records would error out 😖

            – Jake Smith
            Jul 3 '17 at 19:58














          0












          0








          0







          According to the official documentation for SqlPackage on 2017 CTP 2.1, the command to export data and schema is as follows:



          /opt/mssql/bin/sqlpackage /a:Export /ssn:tcp:<your_server> /sdn:<your_database> /su:<username> /sp:<password> /tf:</path/to/your/file.bacpac>


          Looking at your command, it appears you're missing credentials, so I'd give this a try (I've shortened the other parameters as well, and removed the TCP port):



          /opt/mssql/bin/sqlpackage /a:Export /ssn:tcp:localhost /sdn:MyDB /su:<user> /sp:<password> /tf:'/media/jake/1F171B4C75D06418/MyDB.bacpac'





          share|improve this answer













          According to the official documentation for SqlPackage on 2017 CTP 2.1, the command to export data and schema is as follows:



          /opt/mssql/bin/sqlpackage /a:Export /ssn:tcp:<your_server> /sdn:<your_database> /su:<username> /sp:<password> /tf:</path/to/your/file.bacpac>


          Looking at your command, it appears you're missing credentials, so I'd give this a try (I've shortened the other parameters as well, and removed the TCP port):



          /opt/mssql/bin/sqlpackage /a:Export /ssn:tcp:localhost /sdn:MyDB /su:<user> /sp:<password> /tf:'/media/jake/1F171B4C75D06418/MyDB.bacpac'






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 2 '17 at 7:24









          Randolph WestRandolph West

          2,649215




          2,649215













          • Does the same error occur using SELECT statements inside SSMS, or sqlcmd?

            – Randolph West
            Jul 2 '17 at 19:14













          • sqlcmd yes, SSMS yes (through windows vm). I've since taken that other ssd and just installed windows on it and started this whole process over. If I use SSMS to restore the bak file, I don't have any corruption like I did on the linux side.

            – Jake Smith
            Jul 3 '17 at 19:21











          • Interesting. Do you have any thoughts as to what caused the corruption?

            – Randolph West
            Jul 3 '17 at 19:22











          • My only guess is that I was restoring something too old to be compatible with SQL server on Linux. No errors during restoration, but reads past a few thousand records would error out 😖

            – Jake Smith
            Jul 3 '17 at 19:58



















          • Does the same error occur using SELECT statements inside SSMS, or sqlcmd?

            – Randolph West
            Jul 2 '17 at 19:14













          • sqlcmd yes, SSMS yes (through windows vm). I've since taken that other ssd and just installed windows on it and started this whole process over. If I use SSMS to restore the bak file, I don't have any corruption like I did on the linux side.

            – Jake Smith
            Jul 3 '17 at 19:21











          • Interesting. Do you have any thoughts as to what caused the corruption?

            – Randolph West
            Jul 3 '17 at 19:22











          • My only guess is that I was restoring something too old to be compatible with SQL server on Linux. No errors during restoration, but reads past a few thousand records would error out 😖

            – Jake Smith
            Jul 3 '17 at 19:58

















          Does the same error occur using SELECT statements inside SSMS, or sqlcmd?

          – Randolph West
          Jul 2 '17 at 19:14







          Does the same error occur using SELECT statements inside SSMS, or sqlcmd?

          – Randolph West
          Jul 2 '17 at 19:14















          sqlcmd yes, SSMS yes (through windows vm). I've since taken that other ssd and just installed windows on it and started this whole process over. If I use SSMS to restore the bak file, I don't have any corruption like I did on the linux side.

          – Jake Smith
          Jul 3 '17 at 19:21





          sqlcmd yes, SSMS yes (through windows vm). I've since taken that other ssd and just installed windows on it and started this whole process over. If I use SSMS to restore the bak file, I don't have any corruption like I did on the linux side.

          – Jake Smith
          Jul 3 '17 at 19:21













          Interesting. Do you have any thoughts as to what caused the corruption?

          – Randolph West
          Jul 3 '17 at 19:22





          Interesting. Do you have any thoughts as to what caused the corruption?

          – Randolph West
          Jul 3 '17 at 19:22













          My only guess is that I was restoring something too old to be compatible with SQL server on Linux. No errors during restoration, but reads past a few thousand records would error out 😖

          – Jake Smith
          Jul 3 '17 at 19:58





          My only guess is that I was restoring something too old to be compatible with SQL server on Linux. No errors during restoration, but reads past a few thousand records would error out 😖

          – Jake Smith
          Jul 3 '17 at 19:58


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f177774%2fsql-server-on-linux-unable-to-export-to-bacpac%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Ronny Ackermann

          Köttigit

          MySQL 8.0.15 starts normally but any connection hangs