How To Shutdown NC?

Raspbian 4.19.66-v7+
PHP 7.3.9
nginx 1.10.3
Nextcloud 17.0.0.9

I want to shut down all processes which could have access to /var/www in order to make a backup of /var/www by:

sudo rsync -ax --progress /var/www /mnt/new_hdd

What is the appropriate approach?

Maybe stop the nginx Webservice?

Or from the NC Help:
To backup a Nextcloud installation there are four main things you need to retain:

  1. The config folder
  2. The data folder
  3. The theme folder
  4. The database

Maintenance mode

maintenance:mode locks the sessions of logged-in users and prevents new logins in order to prevent inconsistencies of your data. You must run occ as the HTTP user, like this example on Ubuntu Linux:

$ sudo -u www-data php occ maintenance:mode --on

You may also put your server into this mode by editing config/config.php . Change "maintenance" => false to "maintenance" => true :

<?php "maintenance" => true, Don’t forget to change it back to `false` when you are finished.
3 Likes

First. Maintenance mode is important. Not enough to close the webserver since command line occ could be run with cron jobs.

Don’t forget you need to make a backup of your sql database too.

For future reference (plus it mentions how to restore that backup): https://docs.nextcloud.com/server/17/admin_manual/maintenance/backup.html

1 Like

may be this is helpful as well.

1 Like