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

ENDOC-427 add Backing up and restoring Keycloak #427

Merged
merged 4 commits into from
Feb 28, 2022
Merged

ENDOC-427 add Backing up and restoring Keycloak #427

merged 4 commits into from
Feb 28, 2022

Conversation

jyunmitch
Copy link
Collaborator

No description provided.

@jyunmitch jyunmitch added the draft First version of text, not an edit. label Feb 18, 2022
![Entando ID Management UI](./img/import-keycloak.png)

::: Note
If we are using a different environment, with a different hostname, we should import only users or set the If for resource exists to Skip
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nshaw Not sure what to make of this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"if we are" -> "if you are" & "we should" -> "you should"

"only users" -> "users only"

format "If for resource exists" (pretty sure that tag/option is labeled slightly differently ??)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"set the flag for 'If a resource existstoSkip`"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "only users" emphasizes the users as opposed to "users only" emphasizes the subject 'you', so left as is.

Copy link
Contributor

@Lyd1aCla1r3 Lyd1aCla1r3 Feb 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should technically be placed after; i looked it up :P i can point you the references and we can discuss in the style meeting? not a big deal tho.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as an adverb, it is technically ok here? But we can discuss :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no worries, this is grammatically correct! into the weeds but something i was curious about

sidebarDepth: 2
---

# Backing up and Restoring Keycloak
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up -> Up

# Backing up and Restoring Keycloak


This tutorial describes how to backup and restore an active Entando Identity Management Keycloak instance when you need to migrate or restore the realm to another environment.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"...when you need to restore or migrate the realm to..." -- switch order of "restore" and "migrate" to fix grammar

is this sentence redundant? is there a difference between instance and realm?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or simplify to "This tutorial describes how to backup an active Entando Identity Management Keycloak instance and restore it in another environment."

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think realm is the actual data of the instance

1. Login to the original Entando Keycloak server for which you just created the backup.
2. From the left sidebar, go to Import.

3. Click `Select file` button and `upload` the JSON file from the keycloak-backup directory. You will see the following page:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the Select file

should the term keycloak-backup be formatted (parentheses, backticks, etc.) to identify it as an entity and the directory name?

-Dkeycloak.migration.file=/tmp/export/entando-prod-realm.json
```
5. If there are no errors, press Ctrl+C to stop the process.
6. Type `exit` to go back to the VM layer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to return to" sounds a bit cleaner

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or "to close the bash shell in the pod"

A Keycloak instance running on Entando with a database management system (DBMS) in the backend. This procedure will not work with an embedded database.

## Create a Backup of Keycloak Realm
1. From the command line, get the pod name of the Keycloak server you need to backup.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"wish to backup" to deemphasize urgency and highlight the versatility of this action ??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also note this - "In a quickstart environment the pod name will begin with quickstart-kc-server-deployment-"


## Create a Backup of Keycloak Realm
1. From the command line, get the pod name of the Keycloak server you need to backup.
2. Shell into your VM and execute this command to connect to the pod.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pod. -> pod:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change this a bit. In a local env, you shell into a VM, but in a managed K8s you'll just use kubectl directly. -> "Use kubectl to start a bash shell in the pod."

mkdir -p /tmp/export
```

4. Run the following script to retrieve all the data and save it to a JSON file in the export directory. A new Keycloak server will run on a different port (offset=200) to avoid conflicts with the original Entando Keycloak instance.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"retrieve all the data" sounds a bit awkward and unspecified...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to retrieve all the data" -> "to retrieve the data for the entando realm"

```
5. If there are no errors, press Ctrl+C to stop the process.
6. Type `exit` to go back to the VM layer.
7. Execute this command to copy the realm data file to the proper location.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

location. -> location:

![Entando ID Management UI](./img/import-keycloak.png)

::: Note
If we are using a different environment, with a different hostname, we should import only users or set the If for resource exists to Skip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"if we are" -> "if you are" & "we should" -> "you should"

"only users" -> "users only"

format "If for resource exists" (pretty sure that tag/option is labeled slightly differently ??)

```
## Import the Keycloak Realm
1. Login to the original Entando Keycloak server for which you just created the backup.
2. From the left sidebar, go to Import.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should Import be formatted with backticks, etc.?

# Backing up and Restoring Keycloak


This tutorial describes how to backup and restore an active Entando Identity Management Keycloak instance when you need to migrate or restore the realm to another environment.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or simplify to "This tutorial describes how to backup an active Entando Identity Management Keycloak instance and restore it in another environment."

A Keycloak instance running on Entando with a database management system (DBMS) in the backend. This procedure will not work with an embedded database.

## Create a Backup of Keycloak Realm
1. From the command line, get the pod name of the Keycloak server you need to backup.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also note this - "In a quickstart environment the pod name will begin with quickstart-kc-server-deployment-"


## Create a Backup of Keycloak Realm
1. From the command line, get the pod name of the Keycloak server you need to backup.
2. Shell into your VM and execute this command to connect to the pod.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change this a bit. In a local env, you shell into a VM, but in a managed K8s you'll just use kubectl directly. -> "Use kubectl to start a bash shell in the pod."

mkdir -p /tmp/export
```

4. Run the following script to retrieve all the data and save it to a JSON file in the export directory. A new Keycloak server will run on a different port (offset=200) to avoid conflicts with the original Entando Keycloak instance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to retrieve all the data" -> "to retrieve the data for the entando realm"

-Dkeycloak.migration.file=/tmp/export/entando-prod-realm.json
```
5. If there are no errors, press Ctrl+C to stop the process.
6. Type `exit` to go back to the VM layer.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or "to close the bash shell in the pod"

![Entando ID Management UI](./img/import-keycloak.png)

::: Note
If we are using a different environment, with a different hostname, we should import only users or set the If for resource exists to Skip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"set the flag for 'If a resource existstoSkip`"


::: Note
If we are using a different environment, with a different hostname, we should import only users or set the If for resource exists to Skip
:::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need a final statement on the successful completion of the import?

@jyunmitch jyunmitch removed the draft First version of text, not an edit. label Feb 23, 2022
Copy link
Member

@nshaw nshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jyunmitch what do you think of adding this to 6.3.2 as well? I can't think of anything preventing us.

@nshaw nshaw merged commit 549ed3e into main Feb 28, 2022
@nshaw nshaw deleted the ENDOC-427 branch February 28, 2022 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants