Nextcloud on Dietpi v6.34.3

hi,

I have configured nextcloud on dietpi v6.34.3. Had a question, if nextcloud (config & data) is backed up via the dietpi-backup OR is there any other process to back up the nextcloud data and associated databases ?

Please suggest.

Thanks!

See the anwser from Joulinar here.

Almost all the user data is stored in /mnt/dietpi_userdata and dietpi-backup makes a backup of the complete system.

Hi,

many thanks for your message. Usually everything inside /mnt/dietpi_userdata/ should be backed up. Means your Nextcloud data are included as long as dietpi_userdata was not moved to an external device. As well easy to verify. Just do a backup and have a look into backup location afterwards if all your data visible.

Thank you WatskeBart Joulinar

I have the dietpi_userdata location moved / pointed to the external HDD using the dietpi config tool. Does it mean the nextcloud data will not be backed up?

please let me know

Does it mean the nextcloud data will not be backed up?

Correct

Joulinar So, I need to do a dietpi-backup as well as backup the nextcloud data separately.

From the link in the above post - there was mention of Custom Filter–

Is it possible to add/exclude directories?
yes, thats possible. There is an option inside dietpi-backup called Custom Filters

How do I use the custom filter to include the nextcloud data to be backed up using the dietpi-backup?

thanks for your patience!

Edit: I found the option for custom filter in the dietpi-back, tested it. Adding Custom Filter to include a path for external hdd does not backup that path
#+ /path/to/my/file
#+ /path/to/my/directory/

Looks like I will need to backup separately.

Any help, how I could backup the Nextcloud data folder? cp command?

this is similar to following post https://dietpi.com/forum/t/backup-dietpi-userdata-which-has-been-moved-to-external-drive/4802/1

You would need to create your own rsync script to backup data on an external drive. As well I would recommend to have a look to NextCloud docs to check how to backup your database as well. https://docs.nextcloud.com/server/latest/admin_manual/maintenance/backup.html#

A little bit of some discussion around backups https://dietpi.com/forum/t/automate-dietpi-backup/2271/24

Thank you! I will look into it and create a script.

Hopefully Dietpi-Backup will include options for this in future iteration :slight_smile:

@Joulinar I was able to create the script and backup,

Next question… if I restore the backup, will NextCloud be 100% operational after the backup? has anyone tried and tested?

I plan to do it, but want to have some insight before I try, i have almost 10 Gig of photos and videos already backed up, so will be a risk to test this…

your help is appreciated, as always!!

did you backup files only or as well the database?

backed-up only the Files (entire dietpi_userdata - this showed the database files as well) as well as the regular dietpi_backup folder is available

Should I backup the database as well?

usually it should be enough. Not sure if possible but it might be good to test solution working :slight_smile:

I am doing a fresh backup of everything (will take a while) and will give it a go… and post results here :slight_smile:

Need to be ready with a working solution before June 1st (hint… Google Photos deadline :wink: )

still enough time to get t working :slight_smile:

I tried, and it failed.

  1. Should I first install NextCloud on the Fresh Dietpi Install and then Restore
    OR
  2. Simply restore the backup on Fresh Dietpi install.

Both cases failed. When I go to the Web URL link for NextCloud, I get the error

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

Looks like the mariadb.service is failing.

  • Error log:
    Job for mariadb.service failed because the control process exited with error code.
    See “systemctl status mariadb.service” and “journalctl -xe” for details.

Tried re-install of mariaDB, but just does not work.

Any help?

Usually first install NC and restore backup afterwards. Can you check if database server is up?

Looks like the mariadb.service is failing.

  • Error log:
    Job for mariadb.service failed because the control process exited with error code.
    See “systemctl status mariadb.service” and “journalctl -xe” for details.

Tried re-install of mariaDB, but just does not work. Should I post the error logs?

Yes there is an error log on /var/log/

Which one is the exact log file I need to look for?

:/var/log$ ls -l
total 28
-rw-r–r-- 1 root root 0 Jan 11 14:27 Xorg.0.log
-rw-r–r-- 1 root root 0 Jan 11 14:17 Xorg.0.log.old
-rw-r–r-- 1 root root 420 Jan 20 08:38 alternatives.log
drwxr-xr-x 2 root root 100 Jan 20 08:39 apt
-rw-rw---- 1 root utmp 0 Jan 20 08:13 btmp
-rw-r–r-- 1 root root 0 Jan 20 08:11 dietpi-backup.log
-rw-r–r-- 1 root root 0 Dec 29 14:10 dietpi-move_userdata.log
-rw-r–r-- 1 root root 5113 Jan 20 08:39 dpkg.log
-rw-r–r-- 1 root root 0 Jan 5 10:34 fontconfig.log
-rw-rw-r-- 1 root utmp 292292 Jan 20 08:37 lastlog
drwxr-x— 2 www-data www-data 60 Dec 29 13:28 lighttpd
drwxr-s— 2 mysql adm 60 Dec 29 13:31 mysql
-rw------- 1 root root 564 Jan 20 08:57 php7.3-fpm.log
drwx------ 2 root root 40 Sep 10 05:33 private
drwxr-s— 2 redis adm 60 Dec 29 13:32 redis
-rw-rw-r-- 1 root utmp 1152 Jan 20 08:37 wtmp

Inside mysql there should be an error.log