Before asking for help please read "Requesting Help and Suggestions" by clicking on that tab above here.
  • Page:
  • 1

TOPIC:

Automatic Upgrade via CLI 1 month 2 weeks ago #1

  • Roxxor
  • Roxxor's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 13
Hi!
Is there a way to invoke version automatic upgrades from the command line? I have several services running on my own web server and want to streamline the (supervised) update workflow. I wrote a script just to go through all the different system blocks that need to be updated (apt, docker images, nextcloud and webtrees).
Obviously I could somehow try to implement the manual upgrade(not sure how to implement automatic version checks), but why reinvent the wheel when there is already a nice working automatic upgrade mechanism.

Thanks for this great software!

Please Log in or Create an account to join the conversation.

Automatic Upgrade via CLI 1 month 2 weeks ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 16208
No - there is no CLI interface for webtrees at this time.

You'd need a bash script or similar. The basic principle is this:

wget https://path/to/webtrees.zip
unzip -d /tmp webtrees.zip
rm webtrees.zip
rsync -avd /tmp/webtrees /var/www/example.com/webtrees
# Optionally delete old files from certain subfolders...
# Don't do /public, as users often write files there.
rsync -avd --delete /tmp/webtrees/app /var/www/example.com/webtrees/app
rsync -avd --delete /tmp/webtrees/resources /var/www/example.com/webtrees/resources
rsync -avd --delete /tmp/webtrees/views /var/www/example.com/webtrees/views
rm -Rf /tmp/webtrees
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Automatic Upgrade via CLI 1 month 1 week ago #3

Since the automatic updated does not work for me any longer (SQL timeouts)
I did my upgrade very painfully via FTP (about 1.5hrs)
now I do the following:
- use FTP and create or rename: \webtrees\data\offline.txt
- use your cpanel - filemanger and remove the three folders (/app, /vendor, /resources) below webtrees
- upload via ftp the webtrees zip file to one folder below \webtrees
- use your cpanel - filemanager and unzip/extract the webtrees zip file
- remove the webtrees zip file (the file you uploaded)
- rename or remove the webtrees\data\offline.txt

Now the upgrade takes me less then 4min.
Webtree 2.1.6, PHP Version 8.1.7, MySQL 5.6.51

Please Log in or Create an account to join the conversation.

Automatic Upgrade via CLI 1 month 6 days ago #4

  • Bogie
  • Bogie's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Life is good!
  • Posts: 744

...
- use your cpanel - filemanger and remove the three folders (/app, /vendor, /resources) below webtrees
...
- use your cpanel - filemanager and unzip/extract the webtrees zip file

Sounds interesting. What is cpanel filemanager and how can it be invoked?
Bogie
webtrees 2.1.7 | PHP 8.1.7 | MariaDB 10.5.16 | Apache on Ubuntu 12.9
chart modules of @magicsunday, AutoComplete places of @tkempf

Please Log in or Create an account to join the conversation.

Automatic Upgrade via CLI 1 month 6 days ago #5

Comes with the shared hosting plan of Godaddy, but many other hosting providers also use cpanel
Webtree 2.1.6, PHP Version 8.1.7, MySQL 5.6.51

Please Log in or Create an account to join the conversation.

Automatic Upgrade via CLI 1 month 4 days ago #6

  • Bogie
  • Bogie's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Life is good!
  • Posts: 744

No - there is no CLI interface for webtrees at this time.

You'd need a bash script or similar. The basic principle is this:

wget https://path/to/webtrees.zip
unzip -d /tmp webtrees.zip
rm webtrees.zip
rsync -avd /tmp/webtrees /var/www/example.com/webtrees
# Optionally delete old files from certain subfolders...
# Don't do /public, as users often write files there.
rsync -avd --delete /tmp/webtrees/app /var/www/example.com/webtrees/app
rsync -avd --delete /tmp/webtrees/resources /var/www/example.com/webtrees/resources
rsync -avd --delete /tmp/webtrees/views /var/www/example.com/webtrees/views
rm -Rf /tmp/webtrees

A question of understanding about this. If the 3 directories app, resources and vendor are already deleted, can the unzip be done directly into the webtrees directory without using a tmp folder? Are there any reasons not to do this?
Bogie
webtrees 2.1.7 | PHP 8.1.7 | MariaDB 10.5.16 | Apache on Ubuntu 12.9
chart modules of @magicsunday, AutoComplete places of @tkempf

Please Log in or Create an account to join the conversation.

Automatic Upgrade via CLI 1 month 4 days ago #7

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 16208
> Are there any reasons not to do this?

The automatic upgrade does it this way, as it ensures we won't run out of disk space half-way through copying the files.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Automatic Upgrade via CLI 1 month 4 days ago #8

  • Bogie
  • Bogie's Avatar
  • Offline
  • Premium Member
  • Premium Member
  • Life is good!
  • Posts: 744
Ok, thank you, Greg.
Bogie
webtrees 2.1.7 | PHP 8.1.7 | MariaDB 10.5.16 | Apache on Ubuntu 12.9
chart modules of @magicsunday, AutoComplete places of @tkempf

Please Log in or Create an account to join the conversation.

Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 
  • Page:
  • 1
Powered by Kunena Forum