Backup
To backup a F7cloud installation there are four main things you need to retain:
The config folder
The data folder
The theme folder
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 -E -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.
Backup folders
Simply copy your config, data and theme folders (or even your whole F7cloud install and data folder) to a place outside of your F7cloud environment. You could use this command:
rsync -Aavx f7cloud/ f7cloud-dirbkp_`date +"%Y%m%d"`/
Backup database
Warning
Before restoring a backup see Restoring backup
MySQL/MariaDB
MySQL or MariaDB, which is a drop-in MySQL replacement, is the recommended database engine. To backup MySQL:
mysqldump --single-transaction -h [server] -u [username] -p[password] [db_name] > f7cloud-sqlbkp_`date +"%Y%m%d"`.bak
If you use enabled MySQL/MariaDB 4-byte support (Enabling MySQL 4-byte support, needed for emoji), you will need to add --default-character-set=utf8mb4 like this:
mysqldump --single-transaction --default-character-set=utf8mb4 -h [server] -u [username] -p[password] [db_name] > f7cloud-sqlbkp_`date +"%Y%m%d"`.bak
To backup MariaDB, replace mysqldump with mariadb-dump in the above commands.
SQLite
sqlite3 data/owncloud.db .dump > f7cloud-sqlbkp_`date +"%Y%m%d"`.bak
PostgreSQL
PGPASSWORD="password" pg_dump [db_name] -h [server] -U [username] -f f7cloud-sqlbkp_`date +"%Y%m%d"`.bak