nextcloud_ynh icon indicating copy to clipboard operation
nextcloud_ynh copied to clipboard

Use PostgreSQL instead of MySQL (fixes #107)

Open JimboJoe opened this issue 6 years ago • 21 comments

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 : Build Status

pipeline status

When the PR is marked as ready to merge, you have to wait for 3 days before really merging it.

JimboJoe avatar Jun 17 '18 07:06 JimboJoe

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:

JimboJoe avatar Jun 17 '18 15:06 JimboJoe

Hopefully, the Urban Dictionnary is always here to save me ! https://www.urbandictionary.com/define.php?term=wip

maniackcrudelis avatar Jun 17 '18 15:06 maniackcrudelis

Any progress on this? Switching to Postgres would be a big improvement.

rushsteve1 avatar Oct 08 '18 15:10 rushsteve1

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 avatar Mar 06 '19 10:03 JOduMonT

@JOduMonT do you remember which apps wouldn't work with postgres?

autra avatar Nov 12 '19 21:11 autra

@aura nope :( I gave I try to google and nextcloud forum they did'nt remember too :P

JOduMonT avatar Nov 13 '19 01:11 JOduMonT

Ok, because I have used owncloud with postgresql (before using yunohost) during at least 2 years without any issue...

autra avatar Nov 13 '19 13:11 autra

Seems that the mysql 4 byte support issue now causes problems with Nextcloud News, and possibly Mail as well (still investigating that one). :/

Bugsbane avatar Dec 14 '20 01:12 Bugsbane

Migration should works now :gift:

So what should we do now? Do we really want to migrate to PostgreSQL? @YunoHost-Apps/apps-group

kay0u avatar Dec 18 '20 11:12 kay0u

In restore script, don't we need to install PostgreSQL with app_dependencies $pkg_dependencies before restoring the PostgreSQL database?

ericgaspar avatar Dec 18 '20 11:12 ericgaspar

Yep, a fix is coming

kay0u avatar Dec 18 '20 11:12 kay0u

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 ><

kay0u avatar Dec 18 '20 14:12 kay0u

Thanks a lot!!:heart_eyes::heart_eyes: Curiously, MySQL is still the recommended database...?!

JimboJoe avatar Dec 18 '20 20:12 JimboJoe

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 ?)

lapineige avatar Dec 18 '20 21:12 lapineige

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.

kay0u avatar Dec 19 '20 11:12 kay0u

!testme

kay0u avatar Jan 22 '21 12:01 kay0u

:carousel_horse: Test Badge

yunohost-bot avatar Jan 22 '21 12:01 yunohost-bot

!testme

ericgaspar avatar Jun 22 '22 09:06 ericgaspar

Fingers crossed! Test Badge

yunohost-bot avatar Jun 22 '22 09:06 yunohost-bot

Does that mean old yunohost nextcloud won't be able to migrate to PostgreSQL?

Thatoo avatar Jul 03 '22 09:07 Thatoo

No. That means I screwed up trying to rearrange the branches 😱.

ericgaspar avatar Jul 03 '22 09:07 ericgaspar

!testme

ericgaspar avatar Nov 04 '22 17:11 ericgaspar

Fingers crossed! Test Badge

yunohost-bot avatar Nov 04 '22 17:11 yunohost-bot

!testme

ericgaspar avatar Jan 05 '23 14:01 ericgaspar

:carousel_horse: Test Badge

yunohost-bot avatar Jan 05 '23 14:01 yunohost-bot

Thank you so much @ericgaspar for working on that one. I guess the speed bump for all yunohost users will be very big

Limezy avatar Jan 18 '23 02:01 Limezy

!testme

ericgaspar avatar Feb 12 '23 18:02 ericgaspar

(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 )

alexAubin avatar Feb 12 '23 18:02 alexAubin

!testme

ericgaspar avatar Feb 13 '23 10:02 ericgaspar

Alrighty! Test Badge

yunohost-bot avatar Feb 13 '23 10:02 yunohost-bot