Just make sure you have a working backup. It tried to migrate a test instance this morning and wasn’t able to get Nextcloud to connect to the migrated database.
Nextcloud with Letsencrypt using OMV and docker-compose - Q&A
-
- OMV 5.x
- WastlJ
-
-
Then maybe I'd better postpone the migration of the mariadb docker provider, but at the latest by the time nextcloud 21 is available for my HW platform.
-
Hello, i get every day another ip adress.
DuckDNS doesn't update the new ip adress i my case.
Did we need the follow container?
-
Did we need the follow container?
I don't think so, since the duckdns key and subdomain information is listed in the swag portion of the docker-compose file. I haven't tried it myself without it though.
-
Hello, i get every day another ip adress.
DuckDNS doesn't update the new ip adress i my case.
Did we need the follow container?
Yes, that’s the purpose of the container
-
Just make sure you have a working backup. It tried to migrate a test instance this morning and wasn’t able to get Nextcloud to connect to the migrated database.
Then maybe I'd better postpone the migration of the mariadb docker provider, but at the latest by the time nextcloud 21 is available for my HW platform.
With a little more time I was able to successfully migrate the database now. It was a problem of database permissions.
I try to write a small guide tomorrow.
-
Hello, i have trouble with my docker GUIDE installation.
- i don't get updates for my duckdns service.
Why we use "dev-disk-by-label-disk" and not the "uuid"?
@all
When did have check, install the GUIDE [How-To] Nextcloud with Letsencrypt using OMV and docker-compose?
The GUIDE is very old.
Which OMV 5 Debian 10 Base installation should i'm prefer?
-
Which OMV 5 Debian 10 Base installation should i'm prefer
You are getting yourself confused this thread and this Q&A have nothing to do with each other, this guide will simply install Nextcloud with Letsencrypt on OMV using docker compose.
-
I won't to have a OMV 5 Installation with Docker_Nextcloud_SWAG.
This apt update - W: Failed to fetch http:/.......................... is a base for Docker_Nextcloud_SWAG.
-
I won't to have a OMV 5 Installation with Docker_Nextcloud_SWAG.
I know what you want, the HOWTO which this Q&A relates to will do that, I haven't read all this thread but SWAG replaces Letsencrypt I believe.
The change from dev-disk-by-label to to dev-disk-by-uuid was brought about by the changes in OMV, so all one does is substitute/change those references.
-
The GUIDE is very old.
The guide is actively maintained and works, so it doesn't matter how old it is.
-
I try to write a small guide tomorrow.
We would be grateful
Thank you for all the work done in this "how-to"
-
FredK Here's the guide. I hope I didn't forget a step...
I assume you are doing this with root privileges
- Get database password from nextcloud config.php: cat /srv/dev-disk-by-label-disk1/appdata/nextcloud/config/www/nextcloud/config/config.php
- Save the password under 'dbpassword' somewhere
- Enable maintenance mode of nextcloud docker: docker exec nextcloud sudo -u abc php /config/www/nextcloud/occ maintenance:mode --on
- Create database backup: docker exec -it nextclouddb bash
- mysqldump --single-transaction -u root -p nextcloud > /config/nc_backup.bkp
- Enter mariadb_root_password
- exit
- Stop containers: cd /home/docker1/nextcloud && docker-compose down
- Open docker-compose.yml: nano docker-compose.yml
- Comment out old mariadb-container:
Zitat#mariadb:
# - PUID=1000 #change PUID if needed
# - PGID=100 #change PGID if needed
# - MYSQL_ROOT_PASSWORD=mariadbpassword #change password
# - TZ=Europe/Berlin #Change Time Zone if needed
# - /srv/dev-disk-by-label-disk1/appdata/nextclouddb:/config #/srv/dev-disk-by-label-disk1 needs to be adjusted
Below insert new MariaDB-block:
Codemariadb: image: webhippie/mariadb:latest container_name: nextclouddb environment: - MARIADB_ROOT_PASSWORD=mariadbpassword volumes: - /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/mysql:/var/lib/mysql #/srv/dev-disk-by-label-disk1 needs to be adjusted - /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/conf.d:/etc/mysql/conf.d #/srv/dev-disk-by-label-disk1 needs to be adjusted - /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/backup:/var/lib/backup #/srv/dev-disk-by-label-disk1 needs to be adjusted restart: unless-stopped
- Start containers: docker-compose up -d
- Copy backup to new container: cp /srv/dev-disk-by-label-disk1/appdata/nextclouddb/nc_backup.bkp /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/mysql/
- Import database: docker exec -it nextclouddb bash
- mysql -u root -p
- Enter new_mariadb_root_password
- CREATE DATABASE nextcloud;
- GRANT USAGE ON *.* TO 'oc_admin'@'%' IDENTIFIED BY 'enter_dbpassword_from_config.php';
- GRANT ALL PRIVILEGES ON nextcloud.* TO 'oc_admin'@'%' ;
- FLUSH PRIVILEGES;
- EXIT
- mysql -u root -p nextcloud < /var/lib/mysql/nc_backup.bkp
- Enter new_mariadb_root_password
- exit
- Restart nextcloud docker: docker restart nextcloud
- Disable maintenance mode of nextcloud docker: docker exec nextcloud sudo -u abc php /config/www/nextcloud/occ maintenance:mode --off
- Cross your fingers...
-
Thank you Morlan. Tomorrow I'll give it a try. Fingers already crossed.
-
RE: Nextcloud with Letsencrypt using OMV and docker-compose - Q&A
ZitatThen maybe I'd better postpone the migration of the mariadb docker provider, but at the latest by the time nextcloud 21 is available for my HW platform.
ZitatHello Morian, did you mean this guide #533 ?
RE: Nextcloud with Letsencrypt using OMV and docker-compose - Q&A
-
Morlan
I'm stuck at last step (Disable maintenance mode)See my comments inline.
FredK Here's the guide. I hope I didn't forget a step...
....
Before "docker-compose up -d" I inserted a "docker-compose pull"
- Start containers: docker-compose up -d
....
In the next command I changed "oc_admin@%;" to "oc_admin'@'%'"
- GRANT ALL PRIVILEGES ON nextcloud.* TO oc_admin@%;
...
- Disable maintenance mode of nextcloud docker: docker exec nextcloud sudo -u abc php /config/www/nextcloud/occ maintenance:mode --off
I got an exception.
root@helios4:/home/docker1/nextcloud# docker exec nextcloud sudo -u abc php /config/www/nextcloud/occ maintenance:mode --off
An unhandled exception has been thrown:
Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'oc_he'@'nextcloud.nextcloud_default' (using password: YES) in /config/www/nextcloud/lib/private/DB/Connection.php:72
Stack trace:
#0 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1449): OC\DB\Connection->connect()
#1 /config/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(892): Doctrine\DBAL\Connection->getWrappedConnection()
....
Could it be that I created nextcloud in the past as my unprivileged user "he"?
EDIT:
After repeating the database command using oc_he instead of oc_admin disabling maintenance mode was successful.
Nextcloud started, login successful!
-
Zitat
Could it be that I created nextcloud in the past as my unprivileged user "he"?
maybe it’s the user you specified as admin when setting up Nextcloud. Mine was called admin in the Test instance.
I’m glad it worked!
-
Hello Morian, did you mean this guide #533 ?
Yes
-
FredK Here's the guide. I hope I didn't forget a step...
I assume you are doing this with root privileges
- Get database password from nextcloud config.php: cat /srv/dev-disk-by-label-disk1/appdata/nextcloud/config/www/nextcloud/config/config.php
- Save the password under 'dbpassword' somewhere
- Enable maintenance mode of nextcloud docker: docker exec nextcloud sudo -u abc php /config/www/nextcloud/occ maintenance:mode --on
- Create database backup: docker exec -it nextclouddb bash
- mysqldump --single-transaction -u root -p nextcloud > /config/nc_backup.bkp
- Enter mariadb_root_password
- exit
- Stop containers: cd /home/docker1/nextcloud && docker-compose down
- Open docker-compose.yml: nano docker-compose.yml
- Comment out old mariadb-container:
Below insert new MariaDB-block:
Codemariadb: image: webhippie/mariadb:latest container_name: nextclouddb environment: - MARIADB_ROOT_PASSWORD=mariadbpassword volumes: - /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/mysql:/var/lib/mysql #/srv/dev-disk-by-label-disk1 needs to be adjusted - /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/conf.d:/etc/mysql/conf.d #/srv/dev-disk-by-label-disk1 needs to be adjusted - /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/backup:/var/lib/backup #/srv/dev-disk-by-label-disk1 needs to be adjusted restart: unless-stopped
- Start containers: docker-compose up -d
- Copy backup to new container: cp /srv/dev-disk-by-label-disk1/appdata/nextclouddb/nc_backup.bkp /srv/dev-disk-by-label-disk1/appdata/nextclouddb_new/mysql/
- Import database: docker exec -it nextclouddb bash
- mysql -u root -p
- Enter new_mariadb_root_password
- CREATE DATABASE nextcloud;
- GRANT USAGE ON *.* TO 'oc_admin'@'%' IDENTIFIED BY 'enter_dbpassword_from_config.php';
- GRANT ALL PRIVILEGES ON nextcloud.* TO oc_admin@%;
- FLUSH PRIVILEGES;
- EXIT
- mysql -u root -p nextcloud < /var/lib/mysql/nc_backup.bkp
- Enter new_mariadb_root_password
- exit
- Restart nextcloud docker: docker restart nextcloud
- Disable maintenance mode of nextcloud docker: docker exec nextcloud sudo -u abc php /config/www/nextcloud/occ maintenance:mode --off
- Cross your fingers...
Been a long time reader with no input, soz.
1st, Thank you ALL for every input on this thread.
I managed to have all running on a RPi4, flawless.
Just a small remark about this:
I already enabled the 4 Byte UTF support on the DB, as mentioned here: Enabling MySQL 4-byte support — Nextcloud latest Administration Manual latest documentation
With this, shouldn't the commands for backup and restore be sligthly different?!?
BACKUP:
ZitatNote
Also make sure your backup strategy still work. If you use
mysqldump
make sure to add the--default-character-set=utf8mb4
option. Otherwise your backups are broken and restoring them will result in?
instead of the emojis, making files inaccessible.[/BACKUP]
[RESTORE]
Zitat[/RESTORE]
Sorry for asking but I'm not a very knowlegble person on Linux/SQL/etc.
And, since I had to re-do all installation, several times till I got it right, I don't want to mess things up,
Thank you all
-
According to the official database backup documentation you only need to change the restore command.
Try it out. When you stick by the guide your original database stays untouched and can be restored.
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!