# Custom DB - Can I upload/download scripts instead of using Dashboard?

**URL:** <https://community.auth0.com/t/custom-db-can-i-upload-download-scripts-instead-of-using-dashboard/21401>\
**Category:** Get Help\
**Created:** [February 17, 2019, 2:46am UTC](https://community.auth0.com/t/custom-db-can-i-upload-download-scripts-instead-of-using-dashboard/21401 "2019-02-17T02:46:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris-at-arundo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris-at-arundo/32/11127_2.png) [@chris-at-arundo](https://community.auth0.com/u/chris-at-arundo)\
**Post date:** [February 17, 2019, 2:46am UTC](https://community.auth0.com/t/custom-db-can-i-upload-download-scripts-instead-of-using-dashboard/21401/1 "2019-02-17T02:46:56Z")

</div>

Using the dashboard is straightforward enough. But I’d like to test scripts in the sandbox, and then deploy debugged scripts to all my tenants as part of my build/release process. This would be nicer than a bunch of cutting and pasting.

Is this possible?

Thank you,  
Chris

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [February 17, 2019, 3:20am UTC](https://community.auth0.com/t/custom-db-can-i-upload-download-scripts-instead-of-using-dashboard/21401/2 "2019-02-17T03:20:44Z")

</div>

Hi @chris-at-arundo,

I haven’t tried [updating a connection](https://auth0.com/docs/api/management/v2#!/Connections/patch_connections_by_id) with a custom DB script via the management API, but when you get the JSON document for a connection, the custom DB scripts are in the `customScripts` object under the `options` object:

```auto
    "customScripts": {
      "get_user": "function getByEmail(name, callback) {\n ...
      "login": "//when you log in, connect to the LDAP with your ...
    },

```

Note that each script is formatted as a single long string with embedded newlines. You could try hitting the `/patch_connections_by_id` endpoint with a new `"options": { "customScripts": { "get_user": ...` payload.

---

<div class="post-metadata">

**Author:** ![chris-at-arundo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris-at-arundo/32/11127_2.png) [@chris-at-arundo](https://community.auth0.com/u/chris-at-arundo)\
**Post date:** [February 17, 2019, 4:32am UTC](https://community.auth0.com/t/custom-db-can-i-upload-download-scripts-instead-of-using-dashboard/21401/3 "2019-02-17T04:32:49Z")

</div>

Thanks so much for the quick response! This looks pretty promising.

I will check it out tomorrow and post results.

Chris

---

<div class="post-metadata">

**Author:** ![markd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/markd/32/38919_2.png) [@markd](https://community.auth0.com/u/markd)\
**Post date:** [February 17, 2019, 5:19pm UTC](https://community.auth0.com/t/custom-db-can-i-upload-download-scripts-instead-of-using-dashboard/21401/4 "2019-02-17T17:19:32Z")

</div>

Hi @chris-at-arundo,

I should have thought of this earlier: the [github deployments extension](https://auth0.com/docs/extensions/github-deploy) and the [deploy CLI](https://github.com/auth0/auth0-deploy-cli) both support deploying custom DB scripts:

- [https://auth0.com/docs/extensions/github-deploy#deploy-database-connection-scripts](https://auth0.com/docs/extensions/github-deploy#deploy-database-connection-scripts)
- [GitHub - auth0/auth0-deploy-cli: The Auth0 Deploy CLI is a tool that helps you manage your Auth0 tenant configuration. It integrates into your development workflows as a standalone CLI or as a node module.](https://github.com/auth0/auth0-deploy-cli)

You might find the extension and / or deploy CLI themselves useful or, again, the [code](https://github.com/auth0-extensions/auth0-deploy-extensions) behind [them](https://github.com/auth0/auth0-deploy-cli) may prove instructive.

---

<div class="post-metadata">

**Author:** ![chris-at-arundo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris-at-arundo/32/11127_2.png) [@chris-at-arundo](https://community.auth0.com/u/chris-at-arundo)\
**Post date:** [February 18, 2019, 6:47pm UTC](https://community.auth0.com/t/custom-db-can-i-upload-download-scripts-instead-of-using-dashboard/21401/5 "2019-02-18T18:47:29Z")

</div>

Thanks for this too! Those look like they could be perfect. I’ve been slow in checking them out, but I solemnly swear to post results.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [August 29, 2019, 11:18am UTC](https://community.auth0.com/t/custom-db-can-i-upload-download-scripts-instead-of-using-dashboard/21401/6 "2019-08-29T11:18:42Z")

</div>


