Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export clients & client_trusted_domains #8719

Closed
kirrg001 opened this issue Jul 20, 2017 · 4 comments
Closed

Export clients & client_trusted_domains #8719

kirrg001 opened this issue Jul 20, 2017 · 4 comments
Assignees
Labels
import / upgrade life-cycle stuff: Importing, exporting, upgrading and migrating needs:info [triage] Blocked on missing information server / core Issues relating to the server or core of Ghost

Comments

@kirrg001
Copy link
Contributor

kirrg001 commented Jul 20, 2017

The Ghost exporter takes care of excluded tables, see https://github.com/TryGhost/Ghost/blob/lts/core/server/data/export/index.js#L11.

These are: token tables, client and trusted domains.

So if you e.g. export your blog and import the file into your new blog, you have to:

  1. reconfigure your client credentials if you use the public api
  2. you have to re-add trusted domains

We would like to reconsider not exporting clients and trusted domains.

@kirrg001 kirrg001 added LTS server / core Issues relating to the server or core of Ghost labels Jul 20, 2017
@kirrg001 kirrg001 added this to the Upcoming LTS release milestone Jul 20, 2017
@ErisDS ErisDS added import / upgrade life-cycle stuff: Importing, exporting, upgrading and migrating and removed post 1.0.0 labels Aug 3, 2017
@kirrg001 kirrg001 added the needs:info [triage] Blocked on missing information label Sep 8, 2017
@kirrg001 kirrg001 removed this from the Upcoming LTS release milestone Sep 8, 2017
@kirrg001 kirrg001 removed the LTS label Jul 20, 2018
@kirrg001 kirrg001 self-assigned this Jul 20, 2018
@kirrg001
Copy link
Contributor Author

@cobbspur FYI. This issue will be resolved in Ghost 2.0. We export more data in Ghost. This can be helpful in case we need to use a backup JSON.

@kirrg001 kirrg001 added needs:info [triage] Blocked on missing information and removed needs:info [triage] Blocked on missing information labels Jul 20, 2018
@kirrg001
Copy link
Contributor Author

kirrg001 commented Jul 20, 2018

The challenge here is that exporting/importing the trusted domains without the clients doesn't work out of the box, because this table holds a MySQL reference to the clients table and MySQL will complain on import.

The connection of clients <-> trusted domains makes it in theory possible that only specific client credentials are tied to a trusted domain.

Keep in mind that Ghost requires the client credentials only for password authentication and the public api. If you are talking to the API with a Bearer token, client validation is skipped, because client authentication happened already.

Options

  1. We export+import the clients as well. That means on each JSON import you will override your client credentials. Disadvantage is that in worst case you have to re-new your client credentials for e.g. the public api usage, but you should in theory only import a JSON on a fresh/new blog (e.g. move server from a to b, restore backup because something went wrong)

  2. We only export trusted_domains and on import we simply use any existent client id in the database, because the client<>trusted domain feature is not used anyway.

  3. We make it optional to import/export specific, excluded tables.

@kirrg001
Copy link
Contributor Author

  1. We make it optional to import/export specific, excluded tables.

We will go with this path for now.

kirrg001 added a commit that referenced this issue Jul 31, 2018
refs #9742, refs #8719

- you can now use `include` to export extra tables
- admin client won't make use of this option yet, maybe later and optional
- we won't announce this new ability for now (stays hidden)
kirrg001 added a commit that referenced this issue Jul 31, 2018
refs #9742, refs #8719

- make it possible to import more tables (optional)
  - clients, trusted domains
- by default we won't import these tables, you have to tell Ghost using `include`
- we won't announce this ability for now (stays hidden)
kirrg001 added a commit that referenced this issue Aug 3, 2018
refs #9742, refs #8719

- make it possible to import more tables (optional)
  - clients, trusted domains
- by default we won't import these tables, you have to tell Ghost using `include`
- we won't announce this ability for now (stays hidden)
kirrg001 added a commit that referenced this issue Aug 3, 2018
refs #9742, refs #8719

- make it possible to import more tables (optional)
  - clients, trusted domains
- by default we won't import these tables, you have to tell Ghost using `include`
- we won't announce this ability for now (stays hidden)
kirrg001 added a commit that referenced this issue Aug 3, 2018
refs #9742, refs #8719

- you can now use `include` to export extra tables e.g. `include=clients`
- admin client won't make use of this option yet, maybe later and optional
- we won't announce this new ability for now (stays hidden)
kirrg001 added a commit that referenced this issue Aug 3, 2018
refs #9742, refs #8719

- make it possible to import more tables (optional)
  - available tables: clients, trusted domains
- by default we won't import these tables, you have to tell Ghost using `include` (same syntax on export)
- we won't announce this ability for now (stays hidden)
@kirrg001
Copy link
Contributor Author

kirrg001 commented Aug 7, 2018

Closing, because we have added an hidden option to export/import more tables.

@kirrg001 kirrg001 closed this as completed Aug 7, 2018
kirrg001 added a commit that referenced this issue Aug 10, 2018
refs #8719

- initial commit: 40c8eac
- we have forgotten that there is another endpoint which triggers an export (the backup endpoint)
- this endpoint needs to accept the new `include` query param as well (was missing)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import / upgrade life-cycle stuff: Importing, exporting, upgrading and migrating needs:info [triage] Blocked on missing information server / core Issues relating to the server or core of Ghost
Projects
None yet
Development

No branches or pull requests

2 participants