Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PostgreSQL instead of MySQL (fixes #107) #125

Closed
wants to merge 48 commits into from

Conversation

JimboJoe
Copy link
Contributor

@JimboJoe JimboJoe commented Jun 17, 2018

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.

scripts/_common.sh Outdated Show resolved Hide resolved
scripts/backup Outdated Show resolved Hide resolved
scripts/restore Outdated Show resolved Hide resolved
@JimboJoe
Copy link
Contributor Author

As I mentioned "WIP", I pushed that now just to illustrate the current API differences with MySQL helpers. .. Thanks for spotting the glitches anyway 😉

@maniackcrudelis
Copy link
Contributor

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

@rushsteve1
Copy link

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

@JOduMonT
Copy link

JOduMonT commented Mar 6, 2019

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;

@autra
Copy link

autra commented Nov 12, 2019

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

@JOduMonT
Copy link

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

@autra
Copy link

autra commented Nov 13, 2019

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

@Bugsbane
Copy link

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

@kay0u kay0u changed the title [WIP] Use PostgreSQL instead of MySQL (fixes #107) Use PostgreSQL instead of MySQL (fixes #107) Dec 18, 2020
@kay0u
Copy link
Member

kay0u commented Dec 18, 2020

Migration should works now 🎁

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

@ericgaspar
Copy link
Member

ericgaspar commented Dec 18, 2020

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

@kay0u
Copy link
Member

kay0u commented Dec 18, 2020

Yep, a fix is coming

@kay0u
Copy link
Member

kay0u commented Dec 18, 2020

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 c864e08 works, not from testing ><

@JimboJoe
Copy link
Contributor Author

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

@Limezy
Copy link

Limezy commented Feb 24, 2023

https://paste.yunohost.org/raw/iqazirusuk
Any idea of what's happening ? @ericgaspar

@ericgaspar
Copy link
Member

!testme

@yunohost-bot
Copy link
Contributor

🚀
Test Badge

manifest.json Outdated Show resolved Hide resolved
@Limezy
Copy link

Limezy commented Jun 5, 2023

FYI, Running that branch, upgrading fails because it starts by trying to make a backup and dumping the "nextcloud" mySQL database, that obviously doesn't exist !

@ericgaspar
Copy link
Member

!testme

@yunohost-bot
Copy link
Contributor

🌻
Test Badge

@ericgaspar
Copy link
Member

superseded by #581

@ericgaspar ericgaspar closed this Jun 13, 2023
@ericgaspar ericgaspar deleted the enh_postgresql_migration branch June 25, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet