From b25e7e48a750fe059bc95fab8e38fa7d31622ed1 Mon Sep 17 00:00:00 2001 From: sahil28297 Date: Thu, 1 Oct 2020 18:11:49 +0530 Subject: [PATCH] [skip travis] Update site-operations.md --- docs/site-operations.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/docs/site-operations.md b/docs/site-operations.md index 46f51be9..75c1f55a 100644 --- a/docs/site-operations.md +++ b/docs/site-operations.md @@ -230,3 +230,44 @@ Notes: - Use it to install/uninstall custom apps, add system manager user, etc. - To run the command as non root user add the command option `--user frappe`. + + +## Delete/Drop Site + +#### MariaDB Site + +```sh +# Delete/Drop ERPNext site +docker run \ + -e "SITE_NAME=$SITE_NAME" \ + -e "DB_ROOT_USER=$DB_ROOT_USER" \ + -e "MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD" \ + -v _sites-vol:/home/frappe/frappe-bench/sites \ + --network _default \ + frappe/erpnext-worker:$VERSION drop +``` + +#### PostgreSQL Site + +```sh +# Delete/Drop ERPNext site +docker run \ + -e "SITE_NAME=$SITE_NAME" \ + -e "DB_ROOT_USER=$DB_ROOT_USER" \ + -e "POSTGRES_PASSWORD=$POSTGRES_PASSWORD" \ + -v _sites-vol:/home/frappe/frappe-bench/sites \ + --network _default \ + frappe/erpnext-worker:$VERSION drop +``` + +Environment Variables needed: + +- `SITE_NAME`: name of the site to be deleted. Site name is domain name that resolves. e.g. `erp.example.com` or `erp.localhost`. +- `DB_ROOT_USER`: MariaDB/PostgreSQL Root user. +- `MYSQL_ROOT_PASSWORD`: Root User password for MariaDB. +- `FORCE=1`: optional variable which force deletion of the same site. +- `NO_BACKUP=1`: option variable to skip the process of taking backup before deleting the site. + +Environment Variables for PostgreSQL only: + +- `POSTGRES_PASSWORD`: Password for `postgres`. The database root user.