Search code examples
docker-composeofflinehasura

Move my hasura cloud schema, relations, tables etc. and put into my offline docker file using docker-compose


So basically I have my cloud hasura with existing schema, relations tables etc... and i want to offline it using docker and try using metadata export and import that seems not working how can I do it or is there other ways to do it?

this is the docker i want to offline enter image description here

this is my cloud i want to get the schemas or metadata enter image description here

OR MAYBE I JUST MANUALLY RECREATE THE TABLES AND RELATIONS??


Solution

  • When using the steps outlined in the Hasura Quickstart with Docker page then the following steps would help get all the table definitions, relationships etc., setup on the local instance just like it is set up on hasura cloud instance.

    1. Migrate all the database schema and metadata using the steps mentioned in Setting up migrations Since you want to migrate from hasura cloud use the URL of the cloud instance in step 2. Perform steps 3-6 as described in the above link.

    2. Bring up the local docker environment. Ideally edit the docker-compose.yaml file to set HASURA_GRAPHQL_ENABLE_CONSOLE: "false" before running docker-compose up -d.

    3. Resume the process of applying migrations from step 7. Use the endpoint from local instance. For example,

    $ hasura metadata apply --endpoint http://localhost:8080
    $ hasura migrate apply --endpoint http://localhost:8080