From 4eb935be78eeaf1decb7fc109cec09ca18d82854 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Mon, 20 Jan 2020 13:23:21 +0100 Subject: Create pleroma.email mix task Closes: https://git.pleroma.social/pleroma/pleroma/issues/1061 --- docs/administration/CLI_tasks/email.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 docs/administration/CLI_tasks/email.md (limited to 'docs/administration') diff --git a/docs/administration/CLI_tasks/email.md b/docs/administration/CLI_tasks/email.md new file mode 100644 index 000000000..7b7a8457a --- /dev/null +++ b/docs/administration/CLI_tasks/email.md @@ -0,0 +1,24 @@ +# Managing emails + +{! backend/administration/CLI_tasks/general_cli_task_info.include !} + +## Send test email (instance email by default) + +```sh tab="OTP" + ./bin/pleroma_ctl email test [--to ] +``` + +```sh tab="From Source" +mix pleroma.email test [--to ] +``` + + +Example: + +```sh tab="OTP" +./bin/pleroma_ctl email test --to root@example.org +``` + +```sh tab="From Source" +mix pleroma.email test --to root@example.org +``` -- cgit v1.2.3 From 6722dade42d5f404c00386b0336d821028d58d7c Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 6 Feb 2020 15:00:33 +0300 Subject: Simplify in-database config docs Large part of it was no longer true (i.e none of the changes need recompilation anymore and you can't brick an instance by changing them, it's not necessary to manually truncate the db manually anymore) --- docs/administration/CLI_tasks/config.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'docs/administration') diff --git a/docs/administration/CLI_tasks/config.md b/docs/administration/CLI_tasks/config.md index 2af51c247..873775962 100644 --- a/docs/administration/CLI_tasks/config.md +++ b/docs/administration/CLI_tasks/config.md @@ -1,12 +1,16 @@ # Transfering the config to/from the database -!!! danger - This is a Work In Progress, not usable just yet. - {! backend/administration/CLI_tasks/general_cli_task_info.include !} ## Transfer config from file to DB. +!!! note + You need to add the following to your config before executing this command: + + ```elixir + config :pleroma, configurable_from_database: true + ``` + ```sh tab="OTP" ./bin/pleroma_ctl config migrate_to_db ``` @@ -18,7 +22,15 @@ mix pleroma.config migrate_to_db ## Transfer config from DB to `config/env.exported_from_db.secret.exs` +!!! note + In-Database configuration will still be applied after executing this command unless you set the following in your config: + + ```elixir + config :pleroma, configurable_from_database: false + ``` + To delete transfered settings from database optional flag `-d` can be used. is `prod` by default. + ```sh tab="OTP" ./bin/pleroma_ctl config migrate_from_db [--env=] [-d] ``` -- cgit v1.2.3 From 01da001da15e102eff5c38277d9d4c865e8b3fab Mon Sep 17 00:00:00 2001 From: Alexander Strizhakov Date: Fri, 7 Feb 2020 10:48:10 +0300 Subject: fix --- docs/administration/CLI_tasks/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/administration') diff --git a/docs/administration/CLI_tasks/config.md b/docs/administration/CLI_tasks/config.md index 873775962..cc32bf859 100644 --- a/docs/administration/CLI_tasks/config.md +++ b/docs/administration/CLI_tasks/config.md @@ -29,7 +29,7 @@ mix pleroma.config migrate_to_db config :pleroma, configurable_from_database: false ``` -To delete transfered settings from database optional flag `-d` can be used. is `prod` by default. +To delete transfered settings from database optional flag `-d` can be used. `` is `prod` by default. ```sh tab="OTP" ./bin/pleroma_ctl config migrate_from_db [--env=] [-d] -- cgit v1.2.3 From a9e946b99af15a704b9008a9e032d905f5463017 Mon Sep 17 00:00:00 2001 From: Ilja Date: Mon, 10 Feb 2020 23:53:26 +0000 Subject: DOCS Backup/Restore/Migrate your instance * Added "Migrate" to the title because these steps can also be used to migrate the instance to another server * Added an optional step to reinstall pleroma (esp. for migrating servers) * Currently the steps threw an error 'could not execute query: ERROR: function "activity_visibility already exists with the same argument types' * I added a new step to drop and recreate an empty pleroma-database * I played around with the `-c` and `-C` options of pg_restore, but dropping and recreating seemd to be the only way I got it working * This was tested on Debian Stretch, psql (PostgreSQL) 9.6.15 --- docs/administration/backup.md | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'docs/administration') diff --git a/docs/administration/backup.md b/docs/administration/backup.md index 2c70e7bf8..685c45128 100644 --- a/docs/administration/backup.md +++ b/docs/administration/backup.md @@ -1,17 +1,35 @@ -# Backup/Restore your instance +# Backup/Restore/Move/Remove your instance ## Backup 1. Stop the Pleroma service. 2. Go to the working directory of Pleroma (default is `/opt/pleroma`) -3. Run `sudo -Hu postgres pg_dump -d --format=custom -f ` +3. Run `sudo -Hu postgres pg_dump -d --format=custom -f ` (make sure the postgres user has write access to the destination file) 4. Copy `pleroma.pgdump`, `config/prod.secret.exs` and the `uploads` folder to your backup destination. If you have other modifications, copy those changes too. 5. Restart the Pleroma service. -## Restore +## Restore/Move -1. Stop the Pleroma service. -2. Go to the working directory of Pleroma (default is `/opt/pleroma`) -3. Copy the above mentioned files back to their original position. -4. Run `sudo -Hu postgres pg_restore -d -v -1 ` -5. Restart the Pleroma service. +1. Optionally reinstall Pleroma (either on the same server or on another server if you want to move servers). Try to use the same database name. +2. Stop the Pleroma service. +3. Go to the working directory of Pleroma (default is `/opt/pleroma`) +4. Copy the above mentioned files back to their original position. +5. Drop the existing database and recreate an empty one `sudo -Hu postgres psql -c 'DROP DATABASE ;';` `sudo -Hu postgres psql -c 'CREATE DATABASE ;';` +6. Run `sudo -Hu postgres pg_restore -d -v -1 ` +7. If you installed a newer Pleroma version, you should run `mix ecto.migrate`[^1]. This task performs database migrations, if there were any. +8. Restart the Pleroma service. + +[^1]: Prefix with `MIX_ENV=prod` to run it using the production config file. + +## Remove + +1. Optionally you can remove the users of your instance. This will trigger delete requests for their accounts and posts. Note that this is 'best effort' and doesn't mean that all traces of your instance will be gone from the fediverse. + * You can do this from the admin-FE where you can select all local users and delete the accounts using the *Moderate multiple users* dropdown. + * You can also list local users and delete them individualy using the CLI tasks for [Managing users](./CLI_tasks/user.md). +2. Stop the Pleroma service `systemctl stop pleroma` +3. Disable pleroma from systemd `systemctl disable pleroma` +4. Remove the files and folders you created during installation (see installation guide). This includes the pleroma, nginx and systemd files and folders. +5. Reload nginx now that the configuration is removed `systemctl reload nginx` +6. Remove the database and database user `sudo -Hu postgres psql -c 'DROP DATABASE ;';` `sudo -Hu postgres psql -c 'DROP USER ;';` +7. Remove the system user `userdel pleroma` +8. Remove the dependencies that you don't need anymore (see installation guide). Make sure you don't remove packages that are still needed for other software that you have running! -- cgit v1.2.3