npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

umbraco-cloud-fetch-database

v0.3.0

Published

Wizard-based CLI that downloads an Umbraco Cloud database and replaces the LocalDB .mdf/.ldf files in a local Umbraco ASP.NET Core project.

Downloads

780

Readme

umbraco-cloud-fetch-database

Wizard-based CLI for downloading a database from Umbraco Cloud and replacing the LocalDB .mdf / .ldf files of an existing local Umbraco ASP.NET Core project.

Windows-only. LocalDB is a Windows feature; the tool refuses to run elsewhere.

What it does

Run from inside your Umbraco web project (the folder that contains *.csproj):

npx umbraco-cloud-fetch-database@latest

The wizard:

  1. Verifies you are inside an Umbraco web project.
  2. Lets you pick an appsettings.*.json (default appsettings.Development.json).
  3. Detects how LocalDB is configured:
    • via ConnectionStrings:umbracoDbDSN containing (LocalDB) and AttachDbFileName=..., or
    • via Umbraco:Deploy:Settings:PreferLocalDbConnectionString = true (expects umbraco/Data/Umbraco.mdf).
  4. Verifies the existing .mdf / .ldf files exist and are not locked.
  5. Prompts for server / login / password / database of the source (cloud) database.
  6. Shows a summary and asks for confirmation.
  7. Ensures sqlpackage is available (auto-downloads to %USERPROFILE%\.umbraco-cloud-fetch-database\bin\sqlpackage\ if not in PATH).
  8. Backs up the existing files to <dataDir>/backup/<timestamp>/ (keeps the 3 most recent backup folders).
  9. Detaches the local database from (LocalDB)\MSSQLLocalDB.
  10. Exports a .bacpac from the cloud server with sqlpackage /Action:Export.
  11. Imports the bacpac into LocalDB under a temporary database name with sqlpackage /Action:Import.
  12. Detaches the temporary database and moves its .mdf / .ldf to the project's expected paths.
  13. Cleans up the bacpac on success.

Umbraco re-attaches the database on next start because of AttachDbFileName.

Prerequisites

  • Windows with SQL Server Express LocalDB installed (sqllocaldb.exe).
  • sqlcmd in PATH (ships with SQL Server tooling / LocalDB).
  • Node.js 20+.
  • sqlpackage is auto-downloaded if not in PATH.
  • Your Umbraco project must already have a working LocalDB (the .mdf / .ldf must exist on disk). Start the project once if needed so Umbraco creates them.

What it changes

  • Replaces the existing .mdf and .ldf files at the configured path.
  • Creates <dataDir>/backup/<timestamp>/ with the previous files. Keeps the latest 3.
  • Caches sqlpackage under %USERPROFILE%\.umbraco-cloud-fetch-database\bin\sqlpackage\.

The cloud database password is entered interactively and is never stored.

Releasing (maintainers)

CI is GitHub Actions:

  • ci.yml runs build/typecheck on push and PR.
  • release.yml runs on push to main. It uses npm Trusted Publishing (OIDC, no NPM_TOKEN secret) and only publishes if the version in package.json is not already on npm.

To release: bump the version in package.json in a commit, merge to main, done.

License

MIT