graphql-engine/docs/graphql/manual/deployment/downgrading.rst
Phil Freeman 94102c0460
Add downgrade command (close #1156) (#3760)
* Add downgrade command

* Add docs per @lexi-lambda's suggestions

* make tests pass

* Update hdb_version once, from Haskell

* more work based on feedback

* Improve the usage message

* Small docs changes

* Test downgrades exist for each tag

* Update downgrading.rst

* Use git-log to find tags which are ancestors of the current commit

Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
2020-02-07 16:33:12 +05:30

59 lines
2.8 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.. meta::
:description: Downgrade Hasura GraphQL engine version
:keywords: hasura, docs, deployment, downgrade, version
Downgrading Hasura GraphQL engine
=================================
.. contents:: Table of contents
:backlinks: none
:depth: 2
:local:
Step 1: Update Hasura GraphQL engine image version
--------------------------------------------------
The Hasura GraphQL engine runs off a Docker image and downgrades are as simple as changing the image tag to the version you want.
Based on your deployment method, follow the appropriate guide to downgrade the GraphQL engine version you're running:
- :doc:`Updating on Heroku <heroku/updating>`
- :doc:`Updating on Docker <docker/updating>`
- :doc:`Updating on Kubernetes <kubernetes/updating>`
If the GraphQL engine version you are downgrading to has a different catalogue version than your current, you will have to downgrade the catalogue
to the corresponding version manually as described below.
Step 2: Downgrade Hasura catalogue version
------------------------------------------
The Hasura GraphQL engine maintains its metadata state in a "catalogue" as described :ref:`here <hasura_metadata_schema>`.
The schema of the catalogue is versioned. Updates to the Hasura GraphQL engine may have Hasura catalogue version bumps.
During upgrades the server automatically migrates the catalogue to the latest version on startup.
Downgrades to the catalogue need to be carried out manually in case you are attempting to downgrade to a lower Hasura GraphQL engine version.
Downgrading across catalogue versions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can downgrade the catalogue from a particular version to a previous version by executing the ``graphql-engine`` executable on the command line, with the ``downgrade`` command, specifying the desired catalogue version using one of the ``--to-`` flags.
The ``downgrade`` command is not part of the Hasura CLI but rather a command on ``graphql-engine`` itself. The way to execute this command is to run ``docker run hasura/graphql-engine:<VERSION> graphql-engine downgrade --to-<NEW-VERSION>``.
You need to use a newer version of ``graphql-engine`` to downgrade to an older version, since only the newer version knows how to downgrade from that point in time. After youve executed the ``downgrade`` command using the newer version, you should switch to the older version and run ``graphql-engine serve`` as normal.
Catalogue version downgrades will be executed sequentially and in a single transaction.
.. note::
- Running this command while Hasura GraphQL engine is running might lead to unexpected results. It is recommended to first bring down any running
Hasura GraphQL engine instances and then run the SQL statements using an external Postgres client (like ``psql``)
.. contents:: Downgrading
:backlinks: none
:depth: 1
:local: