skip to Main Content

I exported and downloaded my database from Azure as a .bacpac file.

I want to install Umbraco locally and use this database locally.

How do I do it?

Every time when I open the Microsoft SQL Server Management Studio it tries to connect to the database on Azure:
enter image description here

Then when I put the password it will connect to the database on Azure:
enter image description here

But I want to work on the local .bacpac file.

My questions are:

How do I connect on the Microsoft SQL Server Management Studio to the local .bacpac file ?

How do I connect in the Web.config to the local database ? What should I put in the connectionString?

<connectionStrings>
    <remove name="umbracoDbDSN" />
    <add name="umbracoDbDSN" connectionString="Server=tcp:xxxxx.database.windows.net,1433;Data Source=xxxxx.database.windows.net;Initial Catalog=xxxx;Persist Security Info=False;User ID=xxxx;Password=xxxx;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=3600;" providerName="System.Data.SqlClient" />
</connectionStrings>

So basically I want to open and work on the local .bacpac and not on the one on the server, and only after I finish the work to deploy it back.

How do I do it?

Thanks

3

Answers


  1. Chosen as BEST ANSWER

    Thanks a lot for your help! I was able to install Umbraco locally.

    Just one step I had to do before importing the database locally, is setup a local sql server, which I found a good explanation here:

    Create Local SQL Server database Create Local SQL Server database


  2. The .bacpac file is essentially a backup of another database, so you can’t "open" or "connect" to it directly. You need to restore it on your local database server. Which, by the way, you might not have installed as it isn’t part of Management Studio. When you open Management Studio you can just click Cancel on the Connect dialog that has your Azure server in it, and then maybe follow one of the many guides available via Google 😉 Like this one, maybe: https://www.netreo.com/microsoft-azure/how-to-restore-sql-azure-bacpac-to-local-sql-server/

    Login or Signup to reply.
  3. Here are the steps that you should follow;

    • Connect to your local db.

    enter image description here

    • Select Import Data-tier Application.

    enter image description here

    • Select your .bacpac file.

    enter image description here

    • Give a name to your new database and hit finish.

    enter image description here

    enter image description here

    • Create a new login or choose one of the existing ones and set the user mappings as follows so that you can connect to your new Umbraco db using this user’s credentials.

    enter image description here

    enter image description here

    • And here is how you can connect to your local db from your local Umbraco website:

      <add name="umbracoDbDSN" connectionString="server=localhost;database=YourNewUmbracoDbName;user id=youruser;password=yourpassword" providerName="System.Data.SqlClient" />
      
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search