YunoHost-Apps / nextcloud_ynh

Nextcloud package for YunoHost
https://nextcloud.com/
GNU Affero General Public License v3.0
147 stars 63 forks source link

V2 postgresql #597

Open ericgaspar opened 1 year ago

ericgaspar commented 1 year ago
Limezy commented 1 year ago

I have successfully updated my instance using that branch - thanks !

Limezy commented 1 year ago

Using the app control panel to change the PHP-FPM configuration destroys something and leaves to an error 502 ! EDIT : solved by changing php version to 8.2 inside /etc/php/8.2/fpm/pool.d/nextcloud.conf. I guess there is something slightly wrong within the control panel script

ericgaspar commented 1 year ago

!testme

yunohost-bot commented 1 year ago

May the CI gods be with you! Test Badge

ericgaspar commented 12 months ago

!testme

yunohost-bot commented 12 months ago

Meow :cat2: Test Badge

ericgaspar commented 12 months ago

!testme

yunohost-bot commented 12 months ago

:v: Test Badge

ericgaspar commented 11 months ago

!testme

yunohost-bot commented 11 months ago

:carousel_horse: Test Badge

ericgaspar commented 11 months ago

!testme

yunohost-bot commented 11 months ago

Alrighty! Test Badge

Limezy commented 11 months ago

By curiosity, is there a willing to transition to PostgreSQL for the official app branch or is this supposed to live as a parallel branch until PostgreSQL becomes the official recommended database system for Nextcloud ?

ericgaspar commented 11 months ago

where there's a will there's a way. More seriously this branch is more like a parallel universe for now.

ericgaspar commented 10 months ago

!testme

yunohost-bot commented 10 months ago

Fingers crossed! Test Badge

Limezy commented 10 months ago

@ericgaspar thanks for your answer and also thanks for maintaining this parallel universe !

ericgaspar commented 9 months ago

!testme

yunohost-bot commented 9 months ago

Meow :cat2: Test Badge

ericgaspar commented 9 months ago

!testme

yunohost-bot commented 9 months ago

May the CI gods be with you! Test Badge

ericgaspar commented 8 months ago

!testme

Limezy commented 8 months ago

The CI launching bot seems down

ericgaspar commented 8 months ago

!testme

yunohost-bot commented 8 months ago

:sunflower: Test Badge

alexAubin commented 8 months ago
+ sudo -u nextcloud php8.1 --define apc.enable_cli=1 occ --no-interaction --no-ansi db:convert-type --all-apps --clear-schema pgsql nextcloud 127.0.0.1 nextcloud --password=37f7b7c8d96539fff57a1df0 -n

An unhandled exception has been thrown:

Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:139

hmmmzgrmbl okay we have to make sure we have the appropriate phpX.Y-mysql/psql dependency installed during the migration, to be continued

ericgaspar commented 8 months ago

!testme

yunohost-bot commented 8 months ago

:v: Test Badge

ericgaspar commented 8 months ago

!testme

yunohost-bot commented 8 months ago

Meow :cat2: Test Badge

Limezy commented 8 months ago

@alexAubin @ericgaspar do you have any idea about my case where the update fails from an already PostgreSQL migrated instance ? Many thanks !

alexAubin commented 8 months ago

The exact test performed is :

        # Double check the psql is not empty, otherwise big whoops?
        if [[ "$(ynh_psql_execute_as_root --database=$db_name --sql="\dt" 2>/dev/null | wc -l)" == 0 ]]
        then
                ynh_print_warn "Apparently the PostgreSQL DB is not empty, so this is probably OK?"
        else
                ynh_die "Apparently the PostgreSQL DB is also empty, this is kind of worrying, what happened?!"
        fi

so let's check sudo -u postgres psql -d nextcloud <<< "\dt" 2>/dev/null | wc -l ... maybe there's some funky redirection stuff going on, but this should output something like the number of tables inside the DB, like idk, 50, 100, ...

alexAubin commented 8 months ago

My bad, this is stupid, i checked == 0 instead of greater than 0 >_> ...

Limezy commented 8 months ago

sudo -u postgres psql -d nextcloud <<< "\dt" 2>/dev/null | wc -l

This is the output

root@myserver:/home/admin# sudo -u postgres psql -d nextcloud <<< "\dt" 2>/dev/null | wc -l
196

I assume that with your change above, I can now retry to update my instance ? Thanks !

alexAubin commented 8 months ago

I assume that with your change above, I can now retry to update my instance ? Thanks !

Yes

Limezy commented 8 months ago

After another fail because of the "Music" app that I had installed (but not activated...) I was finally able to successfully upgrade, thanks

ericgaspar commented 8 months ago

!testme

yunohost-bot commented 8 months ago

Alrighty! Test Badge

yunohost-bot commented 5 months ago

:carousel_horse: Test Badge

yunohost-bot commented 5 months ago

:books: :bug: Test Badge

ericgaspar commented 3 months ago

!testme

ericgaspar commented 2 months ago

!testme

yunohost-bot commented 2 months ago

:bug: Test Badge

yunohost-bot commented 2 months ago

:sunflower: Test Badge

Limezy commented 1 month ago

Hi ! FYI : https://paste.yunohost.org/raw/sinopawiyi The script is failing in case of an upgrade from an already converted to pgsql instance.

2024-08-29 11:57:43,895: DEBUG - + sudo -u nextcloud php8.3 --define apc.enable_cli=1 occ --no-interaction --no-ansi db:convert-type --all-apps --clear-schema pgsql nextcloud 127.0.0.1 nextcloud --password=********** -n
2024-08-29 11:57:45,071: DEBUG - 
2024-08-29 11:57:45,473: DEBUG - In ConvertType.php line 134:
2024-08-29 11:57:45,473: DEBUG - 
2024-08-29 11:57:45,473: DEBUG -   Can not convert from pg
2024-08-29 11:57:45,473: DEBUG -   sql to pgsql.
2024-08-29 11:57:45,474: DEBUG - 
2024-08-29 11:57:45,474: DEBUG - 
2024-08-29 11:57:45,474: DEBUG - db:convert-type [--port PORT] [--password PASSWORD] [--clear-schema] [--all-apps] [--chunk-size CHUNK-SIZE] [--] <type> <username> <hostname> <database>
2024-08-29 11:57:45,474: DEBUG - 
2024-08-29 11:57:45,474: DEBUG - + ynh_exit_properly
2024-08-29 11:57:45,474: DEBUG - + [[ upgrade =~ ^install$|^upgrade$|^restore$ ]]
2024-08-29 11:57:47,037: ERROR - Could not upgrade nextcloud: An error occurred inside the app upgrade script
Limezy commented 1 month ago

After reading this https://github.com/YunoHost-Apps/nextcloud_ynh/blob/5f3de8b607c38b4ed6ffa1c2051fdfcca7921f7f/scripts/upgrade#L104

And trying on my own server, I found that the Nextcloud sql database still existed, although empty. Maybe older versions of the mysql to pgsql upgrades were emptying the database and not removing it ?

In any case, I'll drop it and relaunch the upgrade

EDIT: It worked indeed. But I have no idea why I still had a "nectcloud" mysql empty database

rodinux commented 1 month ago

EDIT: It worked indeed. But I have no idea why I still had a "nectcloud" mysql empty database

Do you mean "nextcloud" mysql empty database ?

Limezy commented 1 month ago

Yes, sorry typo. I believe that when I moved to this v2_PostgreSQL branch (a very long time ago now), my former mysql nextcloud database was emptied instead of removed

Limezy commented 2 weeks ago

Did you see that the db migration is disabled for now until this bug will be fixed ? https://github.com/nextcloud/server/issues/45257

https://github.com/nextcloud/server/pull/45400

For someone looking to convert his instance to PostgreSQL, don't do it yet (it will fail and you'll have to restore from backup)

ericgaspar commented 2 weeks ago

!testme