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

Old wekan version in snapstore #5226

Open
Danny-Graf opened this issue Nov 27, 2023 · 27 comments
Open

Old wekan version in snapstore #5226

Danny-Graf opened this issue Nov 27, 2023 · 27 comments

Comments

@Danny-Graf
Copy link

Danny-Graf commented Nov 27, 2023

Hello,

in the snapstore is only an "old" version of wekan available:

wekan 6.09 from Lauri Ojansivu (xet7) installed

Best regards,
Danny

@xet7
Copy link
Member

xet7 commented Nov 27, 2023

Yes. There will be automatic upgrade to newest. I'm In Progress of fixing related migration issues.

@xet7
Copy link
Member

xet7 commented Nov 27, 2023

only an "old" version of wekan

No, that is incorrect. Candidate channel has newest WeKan:

https://github.com/wekan/wekan/wiki/OpenSuse

@xet7 xet7 added this to the Platforms milestone Nov 27, 2023
@Ilav1
Copy link

Ilav1 commented Dec 20, 2023

I also have installed version 6.09. When I try to update with these code

sudo snap refresh wekan --channel=latest/candidate

The newest version is installed now. Wekan is not available after updating. When I refresh to the stable version, wekan is available again.

Updating to the newest version is not possible. Maybe you have an other way to update wekan to the candidate version...

@xet7
Copy link
Member

xet7 commented Dec 20, 2023

@Ilav1

I'm currently coding automatic upgrade. It will upgrade all Snap Stable from 6.09 to newest WeKan automatically.

Manual upgrade currently has too many steps, that are time too consuming to do manually:

  1. Mongodump, using Snap 6.09 version of mongodump
  2. Mongorestore, using newest mongorestore
  3. To get attachments visible
    3.1) Rename collections/tables of database:
  rename cfs_gridfs.attachments.files attachments.files
  rename cfs_gridfs.attachments.chunks attachments.chunks
  rename cfs_gridfs.avatars.files avatars.files
  rename cfs_gridfs.avatars.chunks avatars.chunks

3.2) Convert attachments database structure to new format, with upcoming code function:

  convertup cfs.attachments.filerecord attachments
  convertup cfs.avatars.filerecord avatars

I'm currently writing code functions for all that. I do not recommend trying it manually.

@xet7
Copy link
Member

xet7 commented Dec 20, 2023

@Ilav1

These are my current In Progress scripts for upgrade and downgrade. These do not yet make attachments visible, coding that is In Progress.

upgrade.sh

#!/bin/bash

if [ $(whoami) = 'root' ]; then
  echo "Countinuing, because running as root."
else
  echo "Not continuing, because not running as root."
  exit
fi

# SNAP_COMMON=
snap stop wekan.wekan
export LD2=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/snap/wekan/current/lib/x86_64-linux-gnu
export PATH2=$PATH
export PATH=/snap/wekan/current/bin:$PATH
sleep 1
mongodump --port 27019
snap get wekan > snap-settings.txt
snap stop wekan.mongodb
sleep 1
if [ -d "common" ]; then
  rm -rf /var/snap/wekan/common/*
else
  mv /var/snap/wekan/common .
  mkdir /var/snap/wekan/common
fi
snap refresh wekan --channel=latest/candidate
sleep 1
snap start wekan
sleep 1
snap stop wekan.wekan
sleep 1
export PATH=$PATH2
export LD_LIBRARY_PATH=$LD2
mongorestore --drop --port 27019
sleep 1
snap start wekan.wekan

downgrade.sh

#!/bin/bash

if [ $(whoami) = 'root' ]; then
  echo "Countinuing, because running as root."
else
  echo "Not continuing, because not running as root."
  exit
fi

snap stop wekan
sleep 1
rm -rf /var/snap/wekan/common/*
snap refresh wekan --channel=latest/stable
sleep 1
snap stop wekan
sleep 1
rm -rf /var/snap/wekan/common/*
cp -pR common/* /var/snap/wekan/common/
snap start wekan

@Ilav1
Copy link

Ilav1 commented Dec 20, 2023

Nice to know. Thank you for your work. Do you have any suggestions when the script is done?

The stable version will automatically upgrade to the newest version when the script is finished, right?

@xet7
Copy link
Member

xet7 commented Dec 20, 2023

For any code, it is so unpredictable how long it takes to finish it, I don't know.

Most likely I will add that script to this issue, when I have finished it, to make possible manual upgrade.

There is also other questions related to how to upgrade Caddy 1 to newest, when AFAIK Caddy 2 does not support Caddy 1 Caddyfile file format.

@Ilav1
Copy link

Ilav1 commented Jan 9, 2024

One more question @xet7 . When I install the latest candidate on a new system, is the latest candidate version updated automaticly by snap? I think the problem is the old version updating to the newsest isn't it?

@xet7
Copy link
Member

xet7 commented Jan 9, 2024

@Ilav1

Yes, Snap Candidate is updated automatically by Snap, it is always newest version.

After I have fixed migrations, I will release newest WeKan also to Snap Stable. Those migrations will convert Snap Stable to newest WeKan, updating database, attachments etc.

@CasualGarageCoder
Copy link

First of all, thank you for the support and the effort.
I've tried the update script. It fails at mongorestore --drop --port 27019 but it was predictable (not only because the PATH and the LD_LIBRARY_PATH are not valid, but because of the big "Failed: error connecting to db server: no reachable servers". When I've seen this error, I knew that problems were only starting and a long procress/script awaits to finally migrate the whole thing. I'll try to make it work, but I guess there's some pitfalls hidden here and there :)

@0x6DD8
Copy link

0x6DD8 commented Jan 29, 2024

These do not yet make attachments visible, coding that is In Progress.

any updates?
i have tried to manually migrate from snap to docker and the only problem that i have had was the missing attachments

@xet7
Copy link
Member

xet7 commented Jan 29, 2024

@0x6DD8

The point is for you to wait, when I have fixed attachments migration code, and released automatic update, that updates Snap Stable from 6.09 to newest 7.x automatically.

@Danny-Graf
Copy link
Author

Hi @xet7

I just wanted to ask, if there is any update about this topic?

thank you and best regards,
Danny

@xet7
Copy link
Member

xet7 commented Feb 22, 2024

@Danny-Graf

I would like to migrate from MongoDB to SQLite, with:

a) Meteor WeKan and FerretDB https://forums.meteor.com/t/ferretdb-1-18-now-has-oplog-support-trying-replace-mongodb-6-x-with-ferretdb-postgresql-or-ferretdb-sqlite/61092

b) WeKan Studio https://github.com/wekan/wekanstudio

Just because of:

  • Using SQLite takes much less disk space than MongoDB
  • SQL queries are much easier than Javascript queries to MongoDB
  • SQLite works better at Sandstorm
  • It is in plans of Standard for Public code, to use FOSS database https://wekan.github.io/standard-for-public-code/

Alternative would be to try to migrate from MongoDB 3 to MongoDB 6, by fixing this code at Snap. But hurrying that would probably mean much more disk space required when migrating, out of disk space problems, and multiple migrations like MongoDB 3 to MongoDB 6 to SQLite. I would prefer only one migration, to SQLite.

@Danny-Graf
Copy link
Author

@xet7

Thank you, what would that mean for the update? If I migrate to SQLite, how can I update the installed Wekan version?

Best regards,
Danny

@xet7
Copy link
Member

xet7 commented Feb 23, 2024

@Danny-Graf

No, you don't need to migrate anything.

There will be automatic update to WeKan Snap Stable, that will upgrade from 6.09 to newest 7.x.

@Danny-Graf
Copy link
Author

@xet7

Okay, thank you for the information. When the automatic update will be proceeded? Do I need to do anything?

Thank you and best regards,
Danny

@xet7
Copy link
Member

xet7 commented Feb 23, 2024

@Danny-Graf

No, you don't need to do anything. When I have finished additional code, and released it to Snap Stable, it updates all Snap Stable installs wordwide automatically very fast.

There is no exact date when it will happen. It will be when fixes are ready and tested that they work.

@lezioul
Copy link

lezioul commented Feb 23, 2024

@xet7 : sooo..., no more MongoDB, next stable will be using SQLite? (great news, actually)

@xet7
Copy link
Member

xet7 commented Feb 23, 2024

@lezioul

Yes, that is the plan.

@jeroenstoker
Copy link

Is there something I can do to help you?

@xet7
Copy link
Member

xet7 commented Mar 11, 2024

@jeroenstoker

Yes. Send PRs related to any open issues. And tag me with @xet7 if some issue can be closed. These help every WeKan user.

@lorodoes
Copy link
Contributor

#5349

Should be fixed with this pull

@xet7 xet7 closed this as completed Mar 18, 2024
@lezioul
Copy link

lezioul commented Mar 19, 2024

Hi!
Sorry to re-open this issue but i have a question : can we now upgrade from stable to edge?

Best Regards,

lezioul

@xet7 xet7 reopened this Mar 19, 2024
@xet7
Copy link
Member

xet7 commented Mar 19, 2024

@lezioul

No, I think. At least it did not work for me, when I tried to change from Stable to Candidate. MongoDB had some error, related to raw database files of MongoDB 3 not being compatible with MongoDB 6. I presume it requires mongodump from MongoDB 3, and mongorestore to MongoDB 6. Maybe other changes too, if attachments are not visible.

@lezioul
Copy link

lezioul commented Jun 20, 2024

hi xet7,

is there any way to help you manage a seamless transition from wekan stable to edge?
Please, let me know.

Regards

@xet7
Copy link
Member

xet7 commented Jun 20, 2024

@lezioul

It would help for someone to test current migration scripts, do they work at all, and improve them, to migrate from MongoDB 3 to 6:

https://github.com/wekan/wekan/blob/main/snap-src/bin/mongodb-control#L21

https://github.com/wekan/wekan/blob/main/snapcraft.yaml#L200

It's possible to build snap package with:

sudo snap install snapcraft --classic

cd wekan

snapcraft

And then have WeKan Stable Snap 6.09, and try to install new snap, does it upgrade correctly:

sudo snap install wekan.snap --dangerous

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants