Web based family history software

Question Automatic Upgrade via CLI

  • Roxxor
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 9 months ago #1 by Roxxor
Automatic Upgrade via CLI was created by Roxxor
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.

More
1 year 9 months ago #2 by fisharebest
Replied by fisharebest on topic Automatic Upgrade via CLI
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 - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

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

More
1 year 8 months ago #3 by mbeerli
Replied by mbeerli on topic Automatic Upgrade via CLI
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.

  • Bogie
  • Offline
  • Elite Member
  • Elite Member
  • Life is good!
More
1 year 8 months ago #4 by Bogie
Replied by Bogie on topic Automatic Upgrade via CLI

...
- 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.19 | PHP 8.1.27 | MariaDB 10.5.23 | Apache on Ubuntu 12.9
AutoComplete places of @tkempf, chart modules of @magicsunday, Fancy treeview of @justCarmen

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

More
1 year 8 months ago #5 by mbeerli
Replied by mbeerli on topic Automatic Upgrade via CLI
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.

  • Bogie
  • Offline
  • Elite Member
  • Elite Member
  • Life is good!
More
1 year 8 months ago #6 by Bogie
Replied by Bogie on topic Automatic Upgrade via CLI

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.19 | PHP 8.1.27 | MariaDB 10.5.23 | Apache on Ubuntu 12.9
AutoComplete places of @tkempf, chart modules of @magicsunday, Fancy treeview of @justCarmen

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

More
1 year 8 months ago #7 by fisharebest
Replied by fisharebest on topic Automatic Upgrade via CLI
> 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 - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

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

  • Bogie
  • Offline
  • Elite Member
  • Elite Member
  • Life is good!
More
1 year 8 months ago #8 by Bogie
Replied by Bogie on topic Automatic Upgrade via CLI
Ok, thank you, Greg.

Bogie
webtrees 2.1.19 | PHP 8.1.27 | MariaDB 10.5.23 | Apache on Ubuntu 12.9
AutoComplete places of @tkempf, chart modules of @magicsunday, Fancy treeview of @justCarmen

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

Powered by Kunena Forum
}