Backing up ownCloud

To backup an ownCloud installation there are three main things you need to retain:

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

Backup Folders

Simply copy your config and data folder (or even your whole ownCloud install and data folder) to a place outside of your ownCloud environment. You could use this command:

rsync -Aax owncloud/ owncloud-dirbkp_`date +"%Y%m%d"`/

Backup Database


MySQL or MariaDB, which is a drop-in MySQL replacement, is the recommended database engine. To backup MySQL/MariaDB:

mysqldump --lock-tables -h [server] -u [username] -p[password] [db_name] > owncloud-sqlbkp_`date +"%Y%m%d"`.bak


sqlite3 data/owncloud.db .dump > owncloud-sqlbkp_`date +"%Y%m%d"`.bak


PGPASSWORD="password" pg_dump [db_name] -h [server] -U [username] -f owncloud-sqlbkp_`date +"%Y%m%d"`.bak
All documentation licensed under the Creative Commons Attribution 3.0 Unported license.