Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Directus
  3. Connect to existing database

Connect to existing database

Scheduled Pinned Locked Moved Solved Directus
18 Posts 5 Posters 4.0k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fluxus
    wrote on last edited by
    #1

    Hi,

    After some playing with Directus 9 locally, I decided to try it out in live environment. Since I am not that comfortable with manually configuring stuff, I looked into options that would be the easiest for me to get Directus up and running.

    So I went with DigitalOcean/Cloudron combo route. I managed to connect Cloudron with my domain and install Directus.

    That part is fine, but I am missing the option to choose existing DB during install. Is that possible when installing Directus via Cloudron?

    Maybe I am missing something obvious, as I said server/etc configurations are not my forte, I am basically a designer so forgive me if I didn't get everything right about the whole setup 🙂

    girishG 1 Reply Last reply
    0
    • F fluxus

      Hi,

      After some playing with Directus 9 locally, I decided to try it out in live environment. Since I am not that comfortable with manually configuring stuff, I looked into options that would be the easiest for me to get Directus up and running.

      So I went with DigitalOcean/Cloudron combo route. I managed to connect Cloudron with my domain and install Directus.

      That part is fine, but I am missing the option to choose existing DB during install. Is that possible when installing Directus via Cloudron?

      Maybe I am missing something obvious, as I said server/etc configurations are not my forte, I am basically a designer so forgive me if I didn't get everything right about the whole setup 🙂

      girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by girish
      #2

      @fluxus said in Connect to existing database:

      That part is fine, but I am missing the option to choose existing DB during install. Is that possible when installing Directus via Cloudron?

      IIUC, you want the Cloudron Directus installation to use an external existing database (postgresql) ? If that's the case, that is not possible. Cloudron is designed to manage and maintain the database of an app and we don't have a way for apps to connect to external databases.

      If possible, you can import data from your external postgresql into cloudron's postgresql - https://docs.cloudron.io/guides/import-postgresql/ . This way an app's "backup" is complete. It has files/databases/caches etc in a single bundle. This allows you to rollback/update apps easily.

      murgeroM 1 Reply Last reply
      0
      • girishG girish

        @fluxus said in Connect to existing database:

        That part is fine, but I am missing the option to choose existing DB during install. Is that possible when installing Directus via Cloudron?

        IIUC, you want the Cloudron Directus installation to use an external existing database (postgresql) ? If that's the case, that is not possible. Cloudron is designed to manage and maintain the database of an app and we don't have a way for apps to connect to external databases.

        If possible, you can import data from your external postgresql into cloudron's postgresql - https://docs.cloudron.io/guides/import-postgresql/ . This way an app's "backup" is complete. It has files/databases/caches etc in a single bundle. This allows you to rollback/update apps easily.

        murgeroM Offline
        murgeroM Offline
        murgero
        App Dev
        wrote on last edited by
        #3

        @girish If the cloudron server is local to the external db, wouldn't the IP of the external DB be enough to connect with?

        --
        https://urgero.org
        ~ Professional Nerd. Freelance Programmer. ~

        girishG 1 Reply Last reply
        0
        • murgeroM murgero

          @girish If the cloudron server is local to the external db, wouldn't the IP of the external DB be enough to connect with?

          girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by
          #4

          @murgero maybe I didn't understand the question properly. Does Directus allow adding "external" databases inside the app ? If so, my answer is not correct. I thought @fluxus is trying to replace the "postgresql" addon that Directus uses.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            fluxus
            wrote on last edited by
            #5

            Thx for the replies and sorry for not being so clear with my question.

            Is it possible to install Directus on top of existing database(postgresql), with that database being installed/hosted somewhere else(remote access)?

            Directus would be used solely as a nice presentation of data, don't need the headless/API side at the moment. But the existing db can't be migrated, hence the need for remote access to it.

            The above is possible with custom installation, I guess that is not the case with cloudron/directus installation?

            murgeroM girishG 2 Replies Last reply
            0
            • F fluxus

              Thx for the replies and sorry for not being so clear with my question.

              Is it possible to install Directus on top of existing database(postgresql), with that database being installed/hosted somewhere else(remote access)?

              Directus would be used solely as a nice presentation of data, don't need the headless/API side at the moment. But the existing db can't be migrated, hence the need for remote access to it.

              The above is possible with custom installation, I guess that is not the case with cloudron/directus installation?

              murgeroM Offline
              murgeroM Offline
              murgero
              App Dev
              wrote on last edited by
              #6

              @fluxus I think NoCo is a better option for you - I am actually not sure Directus does external dbs

              --
              https://urgero.org
              ~ Professional Nerd. Freelance Programmer. ~

              E 1 Reply Last reply
              1
              • F fluxus

                Thx for the replies and sorry for not being so clear with my question.

                Is it possible to install Directus on top of existing database(postgresql), with that database being installed/hosted somewhere else(remote access)?

                Directus would be used solely as a nice presentation of data, don't need the headless/API side at the moment. But the existing db can't be migrated, hence the need for remote access to it.

                The above is possible with custom installation, I guess that is not the case with cloudron/directus installation?

                girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by girish
                #7

                @fluxus Is this existing database of yours a "directus" db (i.e some external installation of directus was using it previously) or it a generic data source ? If it's the latter, then I don't think directus even supports connecting arbitrary databases like @murgero said. (But I could be wrong).

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  fluxus
                  wrote on last edited by
                  #8

                  @murgero @girish Yes, it is possible. It can be installed on top of existing database, it just adds internal tables prefixed with _directus to your database. I've done it locally and on Stackhero.

                  It even supports remote database connections(that was my setup with Stackhero), and that is what I wanted to do here. Have Directus running via Cloudron on Digital Ocean and database on another host via remote access.

                  doodlemania2D 1 Reply Last reply
                  0
                  • F fluxus

                    @murgero @girish Yes, it is possible. It can be installed on top of existing database, it just adds internal tables prefixed with _directus to your database. I've done it locally and on Stackhero.

                    It even supports remote database connections(that was my setup with Stackhero), and that is what I wanted to do here. Have Directus running via Cloudron on Digital Ocean and database on another host via remote access.

                    doodlemania2D Offline
                    doodlemania2D Offline
                    doodlemania2
                    App Dev
                    wrote on last edited by
                    #9

                    @fluxus to get this to work, you'll need to load a dump of your db tables into the directus db within cloudron. i've done it, it works, but connecting to the db manually is not trivial - you can accomplish it with CLI tools and uploading the dump file with CL interface though if you know how.

                    F 1 Reply Last reply
                    0
                    • doodlemania2D doodlemania2

                      @fluxus to get this to work, you'll need to load a dump of your db tables into the directus db within cloudron. i've done it, it works, but connecting to the db manually is not trivial - you can accomplish it with CLI tools and uploading the dump file with CL interface though if you know how.

                      F Offline
                      F Offline
                      fluxus
                      wrote on last edited by
                      #10

                      @doodlemania2 it's nice to hear that it can be done, thx for the info. Maybe in the future it will be added as an "out-of-the-box" option, after all it is a fundamental part of Directus.

                      Stackhero(which is a service similar to Cloudron I believe) has it out of the box, I got Directus running on top of external db easily.

                      E 1 Reply Last reply
                      2
                      • nebulonN nebulon marked this topic as a question on
                      • nebulonN nebulon has marked this topic as solved on
                      • F fluxus

                        @doodlemania2 it's nice to hear that it can be done, thx for the info. Maybe in the future it will be added as an "out-of-the-box" option, after all it is a fundamental part of Directus.

                        Stackhero(which is a service similar to Cloudron I believe) has it out of the box, I got Directus running on top of external db easily.

                        E Offline
                        E Offline
                        eddowding
                        wrote on last edited by
                        #11

                        Agreed. I've just installed it and spend a good amount of time trying to connect to an external db before coming here to find out what the hell I'm doing wrong.

                        Nothing, it turns out. Which is nice for my ego, but is sad nonetheless.

                        girishG 1 Reply Last reply
                        0
                        • murgeroM murgero

                          @fluxus I think NoCo is a better option for you - I am actually not sure Directus does external dbs

                          E Offline
                          E Offline
                          eddowding
                          wrote on last edited by
                          #12
                          This post is deleted!
                          1 Reply Last reply
                          0
                          • E eddowding

                            Agreed. I've just installed it and spend a good amount of time trying to connect to an external db before coming here to find out what the hell I'm doing wrong.

                            Nothing, it turns out. Which is nice for my ego, but is sad nonetheless.

                            girishG Offline
                            girishG Offline
                            girish
                            Staff
                            wrote on last edited by
                            #13

                            @eddowding 🙂 Directus has no feature to connect to external databases. Connecting to external databases is really app specific. For example, metabase allows connecting to external databases. The Cloudron package itself has no limitations when connecting to external databases.

                            The limitation we do have is that the main database of an app has to be inside Cloudron - this is by design and would make self-hosting and packaging very cumbersome if we allow users to set custom databases (For example, metabases' main database is always inside Cloudron).

                            E F 2 Replies Last reply
                            1
                            • girishG girish

                              @eddowding 🙂 Directus has no feature to connect to external databases. Connecting to external databases is really app specific. For example, metabase allows connecting to external databases. The Cloudron package itself has no limitations when connecting to external databases.

                              The limitation we do have is that the main database of an app has to be inside Cloudron - this is by design and would make self-hosting and packaging very cumbersome if we allow users to set custom databases (For example, metabases' main database is always inside Cloudron).

                              E Offline
                              E Offline
                              eddowding
                              wrote on last edited by
                              #14

                              @girish gotcha - thank you!

                              1 Reply Last reply
                              0
                              • girishG girish

                                @eddowding 🙂 Directus has no feature to connect to external databases. Connecting to external databases is really app specific. For example, metabase allows connecting to external databases. The Cloudron package itself has no limitations when connecting to external databases.

                                The limitation we do have is that the main database of an app has to be inside Cloudron - this is by design and would make self-hosting and packaging very cumbersome if we allow users to set custom databases (For example, metabases' main database is always inside Cloudron).

                                F Offline
                                F Offline
                                fluxus
                                wrote on last edited by
                                #15

                                @girish said in Connect to existing database:

                                @eddowding 🙂 Directus has no feature to connect to external databases.

                                I am confused now 😕 I am aware that English is not my first language, but unless there is a difference between external and remote database connection, I am sure that Directus can connect to external/remote database.

                                Website hosted on server A and Directus hosted on server B, with Directus connected to database from server A.

                                The above is not possible with Cloudron, but it is a feature of Directus.

                                girishG 1 Reply Last reply
                                1
                                • F fluxus

                                  @girish said in Connect to existing database:

                                  @eddowding 🙂 Directus has no feature to connect to external databases.

                                  I am confused now 😕 I am aware that English is not my first language, but unless there is a difference between external and remote database connection, I am sure that Directus can connect to external/remote database.

                                  Website hosted on server A and Directus hosted on server B, with Directus connected to database from server A.

                                  The above is not possible with Cloudron, but it is a feature of Directus.

                                  girishG Offline
                                  girishG Offline
                                  girish
                                  Staff
                                  wrote on last edited by
                                  #16

                                  @fluxus You are right.

                                  What I mean by 'external' is a database that is separate from the 'internal' one. By "internal", i mean, the database an app uses to store it's own data - like users, schema, meta data etc. External database is where the actual data resides.

                                  As an example: redash/metabase have an (internal) database for authenticating users, creating dashboards etc. The actual data comes from external databases. The external databases can be mysql/postgres/redis or a multitude of the connectors they support.

                                  F 1 Reply Last reply
                                  1
                                  • girishG girish

                                    @fluxus You are right.

                                    What I mean by 'external' is a database that is separate from the 'internal' one. By "internal", i mean, the database an app uses to store it's own data - like users, schema, meta data etc. External database is where the actual data resides.

                                    As an example: redash/metabase have an (internal) database for authenticating users, creating dashboards etc. The actual data comes from external databases. The external databases can be mysql/postgres/redis or a multitude of the connectors they support.

                                    F Offline
                                    F Offline
                                    fluxus
                                    wrote on last edited by
                                    #17

                                    @girish OK, now I understand 🙂 Since Directus would install it's own "internal" db tables inside external database, that is simply not possible due to limitations you mentioned above.

                                    Thx for clearing things up on this!

                                    1 Reply Last reply
                                    0
                                    • E Offline
                                      E Offline
                                      eddowding
                                      wrote on last edited by
                                      #18

                                      I'm coming back to this because I'm still confused.

                                      I have a remotely hosted database. I want to build an admin on top of that. That database must continue to be remotely hosted.

                                      Can I build that admin using Directus on Cloudron?

                                      If so, any pointers would be appreciated.

                                      Thank you!

                                      1 Reply Last reply
                                      0
                                      Reply
                                      • Reply as topic
                                      Log in to reply
                                      • Oldest to Newest
                                      • Newest to Oldest
                                      • Most Votes


                                      • Login

                                      • Don't have an account? Register

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Bookmarks
                                      • Search