Skip to content

Commit 91f9349

Browse files
authored
Restoring a deleted organization on GHES (#25663)
1 parent fe43fa8 commit 91f9349

File tree

6 files changed

+65
-2
lines changed

6 files changed

+65
-2
lines changed
Loading
Loading

content/admin/guides.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,6 @@ includeGuides:
136136
- /admin/user-management/requiring-two-factor-authentication-for-an-organization
137137
- /admin/user-management/suspending-and-unsuspending-users
138138
- /admin/overview/creating-an-enterprise-account
139+
- /admin/user-management/managing-organizations-in-your-enterprise/restoring-a-deleted-organization
139140
---
140141

content/admin/user-management/managing-organizations-in-your-enterprise/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ children:
2727
- /streaming-the-audit-logs-for-organizations-in-your-enterprise-account
2828
- /removing-users-from-teams-and-organizations
2929
- /removing-organizations-from-your-enterprise
30+
- /restoring-a-deleted-organization
3031
- /managing-projects-using-jira
3132
- /continuous-integration-using-jenkins
3233
shortTitle: Manage organizations
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Restoring a deleted organization
3+
intro: "You can partially restore an organization that was previously deleted on {% data variables.product.product_location %}."
4+
versions:
5+
ghes: '*'
6+
type: how_to
7+
topics:
8+
- Administrator
9+
- Enterprise
10+
- Organizations
11+
shortTitle: Restore organization
12+
permissions: Site administers can restore an organization on {% data variables.product.product_name %}.
13+
---
14+
15+
## About organization restoration
16+
17+
You can use the site admin dashboard to restore an organization that was previously deleted on {% data variables.product.product_location %}, as long as the audit log Elasticsearch indices contain the data for the `org.delete` event.
18+
19+
Immediately after you restore an organization, the organization will not be exactly the same as it was prior to the deletion. You'll have to manually restore any repositories that were owned by the organization. For more information, see "[Restoring a deleted repository](/admin/user-management/managing-repositories-in-your-enterprise/restoring-a-deleted-repository)."
20+
21+
You can also use the audit log to help you manually re-add teams and organization members. For more information, see "[Restoring members and teams](#restoring-members-and-teams)."
22+
23+
## Restoring an organization
24+
25+
{% data reusables.enterprise_site_admin_settings.access-settings %}
26+
1. Under "Search users, organizations, enterprises, teams, repositories, gists, and applications", search for the organization.
27+
28+
![Screenshot of the search field and Search button](/assets/images/enterprise/stafftools/search-field.png)
29+
30+
1. Under "Deleted accounts", to the right of the organization you want to restore, select the {% octicon "kebab-horizontal" aria-label="The edit icon" %} dropdown menu, then click **Recreate**.
31+
32+
![Screenshot of the dropdown menu for a deleted organization](/assets/images/enterprise/stafftools/recreate-organization.png)
33+
34+
## Restoring members and teams
35+
36+
You can use the audit log to find a list of the previous members and teams of the organization, then recreate them manually. For more information about using the audit log, see "[Auditing users across your enterprise](/admin/user-management/managing-users-in-your-enterprise/auditing-users-across-your-enterprise)."
37+
38+
In all the search phrases below, replace ORGANIZATION with the name of the organization and TEAM with the name of the team.
39+
40+
### Restoring organization members
41+
42+
1. To find all users who were added to and removed from the organization, search the audit log for `action:org.add_member org:ORGANIZATION` and `action:org.remove_member org:ORGANIZATION`.
43+
1. Manually add to the organization each user that should still be a member. For more information, see "[Adding people to your organization](/organizations/managing-membership-in-your-organization/adding-people-to-your-organization)."
44+
45+
### Restoring teams
46+
47+
1. To find each team name, search the audit log for `action:team.create org:ORGANIZATION`.
48+
1. Manually recreate the team. For more information, see "[Creating a team](/organizations/organizing-members-into-teams/creating-a-team)."
49+
1. To find the members that have been added to each team, search for `action:team.add_member team:"ORGANIZATION/TEAM"`.
50+
1. Manually re-add the team members. For more information, see "[Adding organization members to a team](/organizations/organizing-members-into-teams/adding-organization-members-to-a-team)."
51+
1. To find the repositories that the team was granted access to, search for `action:team.add_repository team:"ORGANIZATION/TEAM"`.
52+
1. To find the access level that the team was granted for each repository, search for `action:team.update_repository_permission team:"ORGANIZATION/TEAM"`.
53+
1. Manually give the team access again. For more information, see "[Managing team access to an organization repository](/organizations/managing-access-to-your-organizations-repositories/managing-team-access-to-an-organization-repository)."

content/organizations/managing-organization-settings/deleting-an-organization-account.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ versions:
1212
topics:
1313
- Organizations
1414
- Teams
15-
shortTitle: Delete organization account
15+
shortTitle: Delete organization
1616
---
1717

1818
{% ifversion fpt or ghec %}
@@ -26,7 +26,15 @@ shortTitle: Delete organization account
2626

2727
## 1. Back up your organization content
2828

29-
Once you delete an organization, GitHub **cannot restore your content**. Therefore, before you delete your organization, make sure you have a copy of all repositories, wikis, issues, and project boards from the account.
29+
{% ifversion not ghes %} After you delete an organization, {% data variables.product.company_short %} **cannot restore your content**. Therefore, before{% else %}Before{% endif %} you delete your organization, make sure you have a copy of all repositories, wikis, issues, and project boards from the account.
30+
31+
{% ifversion ghes %}
32+
{% note %}
33+
34+
**Note:** If necessary, a site administrator for {% data variables.product.product_location %} may be able to partially restore a deleted organization. For more information, see "[Restoring a deleted organization](/admin/user-management/managing-organizations-in-your-enterprise/restoring-a-deleted-organization)."
35+
36+
{% endnote %}
37+
{% endif %}
3038

3139
## 2. Delete the organization
3240

0 commit comments

Comments
 (0)