nextcloud_ynh
nextcloud_ynh copied to clipboard
Use PostgreSQL instead of MySQL (fixes #107)
Problem
- MySQL is much less robust than PostgreSQL
Solution
- Migrate Nextcloud to PostgreSQL
PR Status
- [ ] Code finished.
- [ ] Tested with Package_check.
- [ ] Fix or enhancement tested.
- [ ] Upgrade from last version tested.
- [ ] Can be reviewed and tested.
Validation
Minor decision
- Upgrade previous version :
- [ ] Code review :
- [ ] Approval (LGTM) :
- [ ] Approval (LGTM) :
-
CI succeeded :
When the PR is marked as ready to merge, you have to wait for 3 days before really merging it.
As I mentioned "WIP", I pushed that now just to illustrate the current API differences with MySQL helpers. .. Thanks for spotting the glitches anyway :wink:
Hopefully, the Urban Dictionnary is always here to save me ! https://www.urbandictionary.com/define.php?term=wip
Any progress on this? Switching to Postgres would be a big improvement.
FYI:
Yes I'm agreed PostgreSQL is more robust and perform better than mySQL but and I don't remember by heart some nextcloud apps just won't works with PosgreSQL
also most of yunohost user focus more on usability and won't really care which database in background.
This why I think being able to use PostgreSQL should be an option;
@JOduMonT do you remember which apps wouldn't work with postgres?
@aura nope :( I gave I try to google and nextcloud forum they did'nt remember too :P
Ok, because I have used owncloud with postgresql (before using yunohost) during at least 2 years without any issue...
Seems that the mysql 4 byte support issue now causes problems with Nextcloud News, and possibly Mail as well (still investigating that one). :/
Migration should works now :gift:
So what should we do now? Do we really want to migrate to PostgreSQL? @YunoHost-Apps/apps-group
In restore script, don't we need to install PostgreSQL with app_dependencies $pkg_dependencies
before restoring the PostgreSQL database?
Yep, a fix is coming
After a fresh install (from testing) I have this error during the migration:
Warning: In AbstractPostgreSQLDriver.php line 54: Warning: An exception occurred while executing 'SELECT setval('oc_text_documents_id_seq', (SELECT MAX() FROM ))': Warning: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ")" Warning: LINE 1: ...ECT setval('oc_text_documents_id_seq', (SELECT MAX() FROM )) Warning: ^ Warning: In PDOConnection.php line 83: Warning: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ")" Warning: LINE 1: ...ECT setval('oc_text_documents_id_seq', (SELECT MAX() FROM )) Warning: ^ Warning: In PDOConnection.php line 78: Warning: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near ")" Warning: LINE 1: ...ECT setval('oc_text_documents_id_seq', (SELECT MAX() FROM ))
Edit: I don't know why my package_check pass the upgrade test and not my ynh-dev
Edit: Migrate from from the commit https://github.com/YunoHost-Apps/nextcloud_ynh/commit/c864e086625363d91dde6ba78a652011a991a027 works, not from testing ><
Thanks a lot!!:heart_eyes::heart_eyes: Curiously, MySQL is still the recommended database...?!
Database noob here, for the end user what will be the implications ? And do we need to check or do anything before migrating ? (apart from backups ?)
Thanks a lot!!heart_eyesheart_eyes Curiously, MySQL is still the recommended database...?!
Yes, and if we have issue during an upgrade, I think we shouldn't migrate. (Or it's a regression in the 20.0.4 version and we should wait a newer version?)
Database noob here, for the end user what will be the implications ? And do we need to check or do anything before migrating ? (apart from backups ?)
It should be more robust, and the migration must be smooth, but from what I've seen, it's not.
!testme
!testme
Does that mean old yunohost nextcloud won't be able to migrate to PostgreSQL?
No. That means I screwed up trying to rearrange the branches 😱.
!testme
!testme
Thank you so much @ericgaspar for working on that one. I guess the speed bump for all yunohost users will be very big
!testme
(I'm deleting the previous comments from yunohost-bot because we're moving the ci-apps-dev and could be that the job ID corresponds to in fact another app ... Please retrigger the job in a couple minutes / hours, sorry for the inconvenience sweat_smile )
!testme