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

Support for Nextcloud 21 #334

Open
khartahk opened this issue Apr 10, 2021 · 17 comments
Open

Support for Nextcloud 21 #334

khartahk opened this issue Apr 10, 2021 · 17 comments

Comments

@khartahk
Copy link

Will you support Nextcloud 21?

Steps to reproduce

  1. Upgrade to Nextcloud 21.0.1
  2. Extension is missing

Expected behaviour

Support Nextcloud >= 21

Actual behaviour

Extension does not support Nextxloud >= 21

Server configuration

Nextcloud/ownCloud version:
21.0.1

@drdetergent
Copy link

I see also an error on the Nextcloud store for Ocsms that is showing the release 1.10.1 compatible for NC21 because of dependency required nextcloud version >= 9.0.0

and release 1.10.1 is not available for download https://ftp.unix-experience.fr/owncloud-sms/v1.10.1.tar.gz error 404

image

@roydenyates
Copy link

I see also an error on the Nextcloud store for Ocsms that is showing the release 1.10.1 compatible for NC21 because of dependency required nextcloud version >= 9.0.0

and release 1.10.1 is not available for download https://ftp.unix-experience.fr/owncloud-sms/v1.10.1.tar.gz error 404

image

1.10.1 is in fact available at https://github.com/nextcloud/ocsms/archive/refs/tags/v1.10.1.zip

But what's the point since is years old (11 Nov 2016). All very bizarre.

@drdetergent
Copy link

But what's the point since is years old (11 Nov 2016). All very bizarre.

the problem is in incorrect definition of version 1.10.1 that will be forever compatible with all future versions as in Dependecies is set with
Required Nextcloud versions >= 9.0.0

= to be replaced by equals = only

@roydenyates
Copy link

roydenyates commented May 18, 2021

Ok, thanks. The orig dev is active but not on this app, so I guess OCSMS is dormant, although someone did make commits in Dec 2020.

@e-alfred
Copy link
Collaborator

The current problem with a new release of the app is that the database table had to be changed to make the app compatible with newer Nextcloud releases. This means that the data from the old tables has to be migrated in an upgrade step or the sync has to be set up again by the user. Any PR solving the issue is highly welcome!

@brzd
Copy link

brzd commented Jun 25, 2021

Hello!

What's the current status of this project? Is there version for 21 on the process? How can I get ocsms to work in nc21?

@floss4good
Copy link

Hello @e-alfred. I would like to try making a PR for this migration, if not already in progress by someone else.

Would you be kind and help me with some starting point context?
From what I can see the old, deprecated, Database schema (i.e. database.xml) was already removed with 2.2.0 release and from your comment on issue 329 I can understand that some tables and indexes had to be renamed and this is what the required migration should handle.
Since I already use Phone Sync 2.2.0 with Nextcloud 20.0.11 and I can see within the DB that the table names were not changed I assume that the current release still uses the old schema. And this can be confirmed by the fact there are some commits for fixing table / index names after 2.2.0 tag (therefore not included in the current release).

Please correct me if I am wrong until now.

@e-alfred
Copy link
Collaborator

Hello @floss4good, thanks for your offer!

I am currently not able to keep up as fast with all apps due to other commitments, but the problem with this app is that we had to change to the new Database Migrations and had to shorten the table names to be still compatible with newer Nextcloud versions. This means we need a way to migrate the data from the old tables to the new tables.

There are two options:

  1. Users have to set up sync once again which is not very user friendly after upgrading the app.

  2. Do a migration using the new DB Migrations (https://docs.nextcloud.com/server/latest/developer_manual/basics/storage/migrations.html#migration-1-schema-change). This would be ideal, but I am currently not able to put in the time to do this myself.

The changed table names and indexes can be found in this PR: 94a7175

@argon3030
Copy link

argon3030 commented Aug 29, 2021

I was already using ocsms 2.2.0 on NC 20. Working great. Not sure when I originally installed ocsms, it was probably around NC version 18? I can't remember, but in any case, it was already installed and configured and working great. Here's what I did prior to upgrading to NC 21:

  1. Log into the NC mysql database and rename the table 'ocsms_conversation_read_states' to 'ocsms_conv_r_states'. Big thanks to @e-alfred for providing these table names. Rename the table 'ocsms_sendmessage_queue' to 'ocsms_sendmess_queue'. Thank you to @floss4good for sharing the relevant commit. The remaining tables in that commit can be ignored as they're apparently not used.
  2. Edit the file apps/ocsms/db/conversationstatemapper.php and change all instances of 'ocsms_conversation_read_states' to 'ocsms_conv_r_states'.
  3. At this point, ocsms is in a compatible state for NC 21, but it will continue to work fine on NC 20, so there's no rush to upgrade.
  4. Perform the NC upgrade from 20 to 21. It will warn you that there's no compatible version of ocsms, and will disable the app during the upgrade. Once the upgrade is complete, you can re-enable the 'incompatible' ocsms app.

Now after the upgrade to NC 21, ocsms 2.2.0 continues to work properly, and all existing sms data and phone sync connections were preserved, at least in my brief initial testing. Hope this is helpful to someone.

@floss4good
Copy link

And what will happen when a new version – that should perform the tables/indexes name changes – is released?
I just prepared myself a development environment so that I can start working on (and test) a migration for this purpose and now I realize that I should also consider this kind of scenario (when manual changes were made within the DB).

PS: There a second table that should be renamed (and some indexes) – check commit 224382c; but after a quick check it seems to not be used at all.

@argon3030
Copy link

argon3030 commented Aug 29, 2021

@floss4good Actually one of the tables in that commit is being used, or at least it is present in my database. The ocsms_sendmessage_queue. Thank you for sharing this. I've updated my post above to reflect this change. None of the other tables mentioned in that commit are present in my database, so it appears the rest are unused.

It sounds like there are no plans for a new version that performs these db changes any time soon, so I'm not too concerned about it. Can always tweak it manually in the future if required. This at least gets it working today on NC 21.

@floss4good
Copy link

Hello @e-alfred,
Did you noticed my PR (#340) opened during September?

Meanwhile I can see that master branch is gone...

@vlycop
Copy link

vlycop commented Nov 30, 2021

Thankyou very much @floss4good
I am very happy to see someone with the skill to fix this, and the will to do so.

Could you point me to a quick guide about how to replace the store version of this app with your branch so i may finally leave v20 please ?
Or this is only the migration but it doesn't unlock upgrade ?

@schniepp
Copy link

I am not sure if this is helping anything, but I have been just testing the old app (v 2.2.0) on NC 21 and NC 22. I did this by continuously upgrading my older NC instance (basically have been using NC since back in the owncloud times). Then I had to do the "use untested app" thing to re-enable the app.
It appears to be working as normal in both NC 21 and NC 22. I can browse all old messages, and I can sync my phone with NC to see the most recent messages. I don't recall doing any manual fiddling with the database.

@nickvergessen
Copy link
Member

Master has been restored with state of september: #345
So now you can send a PR to bump the version in info.xml if that is enough and then the maintainer can rerelease it.

@nerzhul
Copy link
Collaborator

nerzhul commented Jan 10, 2022

i have a nextcloud 22 at home, i will install it and see if it's fine or not

@erdoukki
Copy link

Working in 23 with #329 (comment)

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

No branches or pull requests