When you install ownCloud from packages, follow these steps to restore your ownCloud installation. Start with a fresh ownCloud package installation in a new, empty directory. Then restore these items from your backup (see backup):
Your ownCloud database.
Your custom theme files, if you have any. (See Theming ownCloud)
When you install ownCloud from the source tarballs you may safely restore your entire ownCloud installation from backup, with the exception of your ownCloud database. Databases cannot be copied, but you must use the database tools to make a correct restoration.
When you have completed your restoration, see Set Strong Directory Permissions.
Simply copy your configuration and data folder to your ownCloud environment. You could use this command, which restores the backup example in backup:
sudo rsync -Aax config data /var/www/owncloud/
There are many ways to restore normal files from backups, and you may use whatever method you are accustomed to.
This guide assumes that your previous backup is called
MySQL is the recommended database engine. To restore MySQL:
sudo -u www-data php occ maintenance:mode --on sudo mysql -h [server] -u [username] -p[password] [db_name] < owncloud-dbbackup.bak sudo -u www-data php occ maintenance:data-fingerprint sudo -u www-data php occ maintenance:mode --off