Skip to content

DOCS-3547: Document MongoDB uninstallation #2248

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/includes/fact-uninstall.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
To completely remove MongoDB from a system, you must remove the MongoDB
applications themselves, the configuration files, and any directories containing
data and logs. The following section guides you through the necessary steps.

.. warning::
This process will *completely* remove MongoDB, its configuration, and *all*
databases. This process is not reversible, so ensure that all of your
configuration and data is backed up before proceeding.
17 changes: 17 additions & 0 deletions source/includes/steps-uninstall-mongodb-enterprise-on-debian.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
stepnum: 1
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: stop-mongodb
---
stepnum: 2
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: remove-packages
replacement:
command: "sudo apt-get purge mongodb-enterprise*"
---
stepnum: 3
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: remove-db
...
19 changes: 19 additions & 0 deletions source/includes/steps-uninstall-mongodb-enterprise-on-redhat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
stepnum: 1
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: stop-mongodb
---
stepnum: 2
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: remove-packages
replacement:
command: "sudo yum erase $(rpm -qa | grep mongodb-enterprise)"
---
stepnum: 3
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: remove-db
replacement:
database_path: /var/lib/mongo
...
19 changes: 19 additions & 0 deletions source/includes/steps-uninstall-mongodb-enterprise-on-suse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
stepnum: 1
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: stop-mongodb
---
stepnum: 2
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: remove-packages
replacement:
command: "sudo zypper remove $(rpm -qa | grep mongodb-enterprise)"
---
stepnum: 3
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: remove-db
replacement:
database_path: /var/lib/mongo
...
17 changes: 17 additions & 0 deletions source/includes/steps-uninstall-mongodb-on-debian.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
stepnum: 1
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: stop-mongodb
---
stepnum: 2
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: remove-packages
replacement:
command: "sudo apt-get purge mongodb-org*"
---
stepnum: 3
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: remove-db
...
36 changes: 36 additions & 0 deletions source/includes/steps-uninstall-mongodb-on-linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
title: Stop MongoDB.
stepnum: 1
ref: stop-mongodb
action:
pre: |
Stop the :program:`mongod` process by issuing the following command:
language: sh
code: |
{{stop_command}}
replacement:
stop_command: "sudo service mongod stop"
---
title: Remove Packages.
stepnum: 2
ref: remove-packages
action:
pre: |
Remove any MongoDB packages that you had previously installed.
language: sh
code: |
{{command}}
---
title: Remove Data Directories.
stepnum: 3
ref: remove-db
action:
pre: |
Remove MongoDB databases and log files.
language: sh
code: |
sudo rm -r {{log_path}}
sudo rm -r {{database_path}}
replacement:
log_path: /var/log/mongodb
database_path: /var/lib/mongodb
...
19 changes: 19 additions & 0 deletions source/includes/steps-uninstall-mongodb-on-redhat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
stepnum: 1
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: stop-mongodb
---
stepnum: 2
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: remove-packages
replacement:
command: "sudo yum erase $(rpm -qa | grep mongodb-org)"
---
stepnum: 3
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: remove-db
replacement:
database_path: /var/lib/mongo
...
19 changes: 19 additions & 0 deletions source/includes/steps-uninstall-mongodb-on-suse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
stepnum: 1
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: stop-mongodb
---
stepnum: 2
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: remove-packages
replacement:
command: "sudo zypper remove $(rpm -qa | grep mongodb-org)"
---
stepnum: 3
source:
file: steps-uninstall-mongodb-on-linux.yaml
ref: remove-db
replacement:
database_path: /var/lib/mongo
...
2 changes: 1 addition & 1 deletion source/tutorial/install-mongodb-enterprise-on-amazon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Run MongoDB Enterprise
----------------------

.. |mongod-user| replace:: ``mongod``
.. |mongod-datadir| replace:: ``/var/lib/mongo``
.. |mongod-datadir| replace:: ``/data/db``

.. include:: /includes/fact-installation-directories.rst

Expand Down
7 changes: 7 additions & 0 deletions source/tutorial/install-mongodb-enterprise-on-debian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ Run MongoDB Enterprise
.. include:: /includes/fact-installation-directories.rst

.. include:: /includes/steps/run-mongodb-on-debian.rst

Uninstall MongoDB
-----------------

.. include:: /includes/fact-uninstall.rst

.. include:: /includes/steps/uninstall-mongodb-enterprise-on-debian.rst
7 changes: 7 additions & 0 deletions source/tutorial/install-mongodb-enterprise-on-red-hat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,10 @@ Run MongoDB Enterprise
.. include:: /includes/fact-installation-directories.rst

.. include:: /includes/steps/run-mongodb-on-a-linux-distribution.rst

Uninstall MongoDB
-----------------

.. include:: /includes/fact-uninstall.rst

.. include:: /includes/steps/uninstall-mongodb-enterprise-on-redhat.rst
7 changes: 7 additions & 0 deletions source/tutorial/install-mongodb-enterprise-on-suse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ Run MongoDB Enterprise
.. include:: /includes/fact-installation-directories.rst

.. include:: /includes/steps/run-mongodb-on-a-linux-distribution.rst

Uninstall MongoDB
-----------------

.. include:: /includes/fact-uninstall.rst

.. include:: /includes/steps/uninstall-mongodb-enterprise-on-suse.rst
7 changes: 7 additions & 0 deletions source/tutorial/install-mongodb-enterprise-on-ubuntu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ Run MongoDB Enterprise
.. include:: /includes/fact-installation-directories.rst

.. include:: /includes/steps/run-mongodb-on-debian.rst

Uninstall MongoDB
-----------------

.. include:: /includes/fact-uninstall.rst

.. include:: /includes/steps/uninstall-mongodb-enterprise-on-debian.rst
7 changes: 7 additions & 0 deletions source/tutorial/install-mongodb-on-amazon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@ Run MongoDB
.. include:: /includes/fact-installation-directories.rst

.. include:: /includes/steps/run-mongodb-on-a-linux-distribution.rst

Uninstall MongoDB
-----------------

.. include:: /includes/fact-uninstall.rst

.. include:: /includes/steps/uninstall-mongodb-on-redhat.rst
7 changes: 7 additions & 0 deletions source/tutorial/install-mongodb-on-debian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ Run MongoDB
.. include:: /includes/fact-installation-directories.rst

.. include:: /includes/steps/run-mongodb-on-debian.rst

Uninstall MongoDB
-----------------

.. include:: /includes/fact-uninstall.rst

.. include:: /includes/steps/uninstall-mongodb-on-debian.rst
7 changes: 7 additions & 0 deletions source/tutorial/install-mongodb-on-red-hat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,10 @@ Run MongoDB
.. include:: /includes/fact-installation-directories.rst

.. include:: /includes/steps/run-mongodb-on-a-linux-distribution.rst

Uninstall MongoDB
-----------------

.. include:: /includes/fact-uninstall.rst

.. include:: /includes/steps/uninstall-mongodb-on-redhat.rst
7 changes: 7 additions & 0 deletions source/tutorial/install-mongodb-on-suse.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,10 @@ Run MongoDB
.. include:: /includes/fact-installation-directories.rst

.. include:: /includes/steps/run-mongodb-on-a-linux-distribution.rst

Uninstall MongoDB
-----------------

.. include:: /includes/fact-uninstall.rst

.. include:: /includes/steps/uninstall-mongodb-on-suse.rst
7 changes: 7 additions & 0 deletions source/tutorial/install-mongodb-on-ubuntu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ Run MongoDB
.. include:: /includes/fact-installation-directories.rst

.. include:: /includes/steps/run-mongodb-on-debian.rst

Uninstall MongoDB
-----------------

.. include:: /includes/fact-uninstall.rst

.. include:: /includes/steps/uninstall-mongodb-on-debian.rst