Connect to existing database
-
@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.
-
-
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?
-
-
@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.
-
@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.
-
@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.
-
N nebulon marked this topic as a question on
-
N nebulon has marked this topic as solved on
-
-
@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).
-
@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.
-
@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.
-
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!