Files
nextcloud-docs/admin_manual/maintenance/backup.rst
Morris Jobke 2bc02b23f2 Improve sidebar headings
* remove term Nextcloud in headings - it only adds noise
* unify headings to have them grouped by wording (Upgrade ...)
* reduce the length of headings

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-05-14 18:22:41 -05:00

45 lines
1.0 KiB
ReStructuredText

======
Backup
======
To backup an Nextcloud installation there are four main things you need to retain:
#. The config folder
#. The data folder
#. The database
#. The theme folder
Backup Folders
--------------
Simply copy your config, data and theme folders (or even your whole Nextcloud install and data folder) to a place outside of
your Nextcloud environment. You could use this command::
rsync -Aax nextcloud/ nextcloud-dirbkp_`date +"%Y%m%d"`/
Backup Database
---------------
.. warning:: Before restoring a backup see :doc:`restore`
MySQL/MariaDB
^^^^^^^^^^^^^
MySQL or MariaDB, which is a drop-in MySQL replacement, is the recommended
database engine. To backup MySQL/MariaDB::
mysqldump --single-transaction -h [server] -u [username] -p[password] [db_name] > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak
SQLite
^^^^^^
::
sqlite3 data/owncloud.db .dump > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak
PostgreSQL
^^^^^^^^^^
::
PGPASSWORD="password" pg_dump [db_name] -h [server] -U [username] -f nextcloud-sqlbkp_`date +"%Y%m%d"`.bak