Projects tigase _server server-core Issues #908
Make upgrading and roll-back more automatic (#908)
Closed
wojciech.kapcia@tigase.net opened 7 years ago

A relatively simple script that would:

  • make a backup of existing data;

  • deploy new version;

  • perform the upgrade.

Allow performing full rollback to previously installed version.

tigase-upgrade.sh

Andrzej Wójcik (Tigase) commented 7 years ago

I've created a script for updating to a newer version and rollbacking upgrade. It makes backup of Tigase installation in the same directory in which Tigase is installed before the upgrade and before rollback as well. Archives are named as ${original_installation_directory}_backup-${date_with_time} for backup made during upgrade and ${original_installation_directory}_rollback-${date_with_time} for backup made during rollback.

Usage:

./tigase-upgrade.sh {upgrade|rollback} install_package install_directory

Install package may be local file or http or https URL - in case of URL package will be downloaded and removed afterward. URLs are also supported for rollbacks.

Second parameter - install_directory is required. I know you suggested to make it optional, but this directory is being removed and using parent of a local directory of the script may cause issues - in my case I had to restore my workspace directory as it got removed (hopefully I had a backup). Due to that (operation is destructive), I decided to force the user to pass directory which should be upgraded/rollbacked.

Wojciech, please review if it works ok for you or you need something more. The script is attached to this issue as it was hard to find a good place for it as it is not confirmed to be working, so it should not be publicly available.

wojciech.kapcia@tigase.net commented 6 years ago

It looks to be working fine. I would change creating archive and removing old files (tar/rm) to simple moving to backup location (mv), especially to avoid possible data loss as happened to you.

Andrzej Wójcik (Tigase) commented 6 years ago

I've improved this script to make it more robust. I've added support (by default enabled) to make a backup to directory. However, I've added a new parameter which when set to tar will create a backup in .tar.gz archive.

wojciech.kapcia@tigase.net commented 6 years ago

I ironed out a couple of issues, added it to documentation with simple guide and marked it as experimental.

issue 1 of 1
Type
New Feature
Priority
Normal
Assignee
RedmineID
6401
Version
tigase-server-8.0.0
Spent time
72h 30m
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#908
Please wait...
Page is in error, reload to recover