Upgrading the TeamDrive Host Server

General Upgrade Notes

There are two basic approaches to updating a TeamDrive Host Server: in-place, by replacing the software with a newer version on the live system, or starting a new instance and migrating the configuration and data (MySQL Database and Space Volumes) to the new instance.

For older installations, performing a migration to a freshly installed instance might be the better approach, to get rid of accumulated “cruft” and to start from a clean slate. In case the current system is still running a 32-bit installation, moving to a 64-bit system is required, as newer versions of the Host Server no longer support 32-bit environments.

Updating requires a service interruption, as the Host Server components (e.g. the Apache HTTP Server) need to be stopped while the update is in progress. Short downtimes usually pass unnoticed by the TeamDrive Clients, they will simply try again after a short waiting period. Local Client operations can continue.

The Host Server-specific MySQL Databases and Space Volumes are the two crucial pieces of data that need to be preserved during updates. Take backups prior to performing an update and verify they worked correctly. In case of an in-place upgrade, both the databases and Space Volumes can be taken over “as is”. When performing a migration to a new instance, the databases and volumes need to be copied or moved to the new host.

Updates between different Host Server versions (e.g. from 3.0.011 to 3.0.013) usually require changes to the MySQL table structures. Starting with version 3.0.013, these changes are applied automatically when starting the service after updating. Reversing these changes (e.g. reverting to the previous version) requires going back to the previous backup, there is no automatic roll-back of changes to the database/table structures.

Starting with version 3.0.013, updates to a new build (e.g. from 3.0.013.0 to 3.0.013.1) can be performed using yum/RPM. Updating from older versions requires manual intervention, as the installations were performed without automatic package management.

In-place Upgrading Version 3.6 to a Newer Build

The use of RPM packages makes updating from one build to another (e.g. from 3.6.0 to 3.6.1) a fairly straightforward and automatic process.

Usually, you can simply replace the existing packages while the service is running. The update performs an immediate restart of the services (httpd and td-hostserver automatically):

[root@hostserver ~]# yum update td-hostserver

Check the chapter Release Notes - Version 3.6 for the changes introduced in each build.

In-place Upgrading from 3.0.013 or 3.5 to 3.6

These instructions assume a default installation of the TeamDrive Host Server (version 3.0.013 / 3.5) on RHEL6 or a derivative distribution like CentOS 6 (64-bit) that was set up based on the Host Server installation instructions or using the TeamDrive Host Server Virtual Appliance for VMware.

The overall procedure is similar in all cases — we’ll remove the old software components while maintaining the MySQL databases and Space Volumes, install the current versions of the Host Server packages and and migrate a few configuration settings by performing the following steps:

  • Stop the Apache HTTP Server and TeamDrive Host Server processes
  • Perform a backup of the Host Server’s MySQL Databases
  • Update the Host Server RPM package yvva and td-hostserver
  • Update the configuration files and database
  • Start the TeamDrive Hosting Service and Apache HTTP Server, check the log files for any errors
  • Test the new setup with a local test client before allowing all user Clients to connect to the new instance again

The following paragraphs explain these steps in more detail.

Step 1) Stop the TeamDrive Services

As a first step, the currently running TeamDrive Hosting Services need to be shut down.

Start by stopping the Apache HTTP Server:

[root@hostserver ~]# service httpd stop

Next, stop the TeamDrive Hosting Service:

[root@hostserver ~]# service td-hostserver stop

and in case of using a S3 compatible object store, stop the s3d service:

[root@hostserver ~]# service s3d stop

Step 2) Create a MySQL Backup

After all TeamDrive Services have been stopped, you should now create a backup of the MySQL databases, e.g. using mysqldump:

[root@hostserver ~]# mysqldump -u root -p --force \
--databases hostapilog pspace \
| gzip > td-hostserver-mysql-$(date +%Y-%m-%d_%H.%M).sql.gz

Step 3) Install the new Host Server Software

Install the new Host Server components (td-hostserver and yvva) from the dedicated TeamDrive Host Server yum repository:

[root@hostserver ~]# wget -O /etc/yum.repos.d/td-hostserver.repo \
http://repo.teamdrive.net/td-hostserver.repo
[root\@hostserver ~]# yum update td-hostserver yvva

Yum might show this warning:

warning: /etc/httpd/conf.d/td-hostserver.httpd.conf created as
/etc/httpd/conf.d/td-hostserver.httpd.conf.rpmnew

Please compare both files and take over new or missing values from td-hostserver.httpd.conf.rpmnew to the existing td-hostserver.httpd.conf.

Version 3.5 and later requieres the following settings in the mysql configuration file /etc/my.cnf. Please add if not already set (the max_connections=512 is the minimum value; it might be necessary to increase the value on your system depending on how many clients are connected to your server):

max_allowed_packet=4M
max_connections=512

Check the /etc/httpd/conf.d/ssl.conf and remove this block, if it exists:

RewriteEngine on
RewriteLogLevel 0
RewriteLog "/var/log/httpd/rewrite.log"
RewriteRule ^/admin$ /admin/ [R]
RewriteRule ^/admin(.*) /yvva/p1a$1 [PT]
RewriteRule ^/pbas/p1_as/api/(.*)$ /yvva/api/$1 [PT]
RewriteRule ^/pbas/p1_as/p1a/(.*)$ /primespace/admin/$1 [PT]

The block will be replaced by the Include statement at the end of the default <VirtualHost> section in /etc/httpd/conf.d/ssl.conf:

#   Per-Server Logging:
#   The home of a custom SSL log file. Use this when you want a
#   compact non-error SSL logfile on a virtual host basis.
CustomLog logs/ssl_request_log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

Include conf.d/td-hostserver.httpd.conf.ssl
</VirtualHost>

Step 4) Update the database

Start the Yvva Runtime Environment’s commandline shell yvva to perform the database updates. The updates will be directly executed when starting yvva. The amount of update steps depends on the existing version. When updating from the lastest 3.5 version, you will see this output:

[root@hostserver ~] yvva
Welcome to yvva shell (version 1.3.8).
Enter "go" or end the line with ';;' to execute submitted code.
For a list of commands enter "help".

      161124 12:31:41 [Notice] *** Version 3.6: Adding column Space.DeleteTime
      161124 12:31:41 [Notice] ALTER TABLE pspace.Space ADD DeleteTime TIMESTAMP NULL AFTER ModifyTime
      161124 12:31:41 [Notice] *** Version 3.6: Adding column Space.DeletedBy
      161124 12:31:41 [Notice] ALTER TABLE pspace.Space ADD DeletedBy INT UNSIGNED NULL AFTER DeleteTime
      161124 12:31:41 [Notice] *** Version 3.6: Adding column Owner.RegServerName
      161124 12:31:41 [Notice] ALTER TABLE pspace.Owner ADD RegServerName VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL AFTER UserName
      161124 12:31:41 [Notice] *** Version 3.6: Adding column Owner.RegPubMod
      161124 12:31:41 [Notice] ALTER TABLE pspace.Owner ADD COLUMN RegPubMod INT UNSIGNED NULL AFTER RegServerName
      161124 12:31:41 [Notice] *** Version 3.6: Adding column Owner.RegConnectStatus
      161124 12:31:41 [Notice] ALTER TABLE pspace.Owner ADD COLUMN RegConnectStatus VARCHAR(400) CHARACTER SET utf8 COLLATE utf8_bin NULL AFTER RegPubMod
      161124 12:31:41 [Notice] *** Version 3.6: Change collation of Owner.Email to case-insensitive
      161124 12:31:41 [Notice] ALTER TABLE pspace.Owner MODIFY Email VARCHAR(256) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL
      161124 12:31:41 [Notice] *** Version 3.6.1: Adding column Owner.RegDistCode
      161124 12:31:41 [Notice] ALTER TABLE pspace.Owner ADD COLUMN RegDistCode VARCHAR(20) CHARACTER SET utf8 COLLATE utf8_bin NULL AFTER RegServerName

RESTORE COMMANDS:
-----------------
To get help on restore commands, enter:

restore_help;;

>

You can close the yvva session by typing quit or pressing Ctrl+D on the > prompt.

Step 5) Start the Host Server Components

Now start the TeamDrive Hosting Service:

[root@hostserver ~]# service td-hostserver start
Starting TeamDrive Hosting Services:                       [  OK  ]

Check the log file for any errors:

[root@hostserver ~]# less /var/log/td-hostserver.log

Next, start the Apache HTTP Server:

[root@hostserver ~]# service httpd start
Starting httpd:                                            [  OK  ]

Check the log files for any errors:

[root@hostserver ~]# less /var/log/httpd/error_log
[root@hostserver ~]# less /var/log/mod_yvva.log
[root@hostserver ~]# less /var/log/td-hostserver.log

And in case of using a S3 compatible object store, start the s3d service:

[root@hostserver ~]# service s3d start
Starting TeamDrive S3 Daemon:                              [  OK  ]

In case of any errors, check the chapter Troubleshooting for guidance.

Step 6) Log into the Administration Console

After the services have been started, try logging into the Administration Console and verify the settings.

Logging into the Administration Console with the HostAdmin user account. If you don’t recall the password you used, see chapter Changing an Admin User’s Password for details on how to reset it.

Step 7) Enable the TeamDrive Hosting Service at System Boot

If the update was successful and the service is up and running, make sure it gets started automatically when the system reboots:

[root@hostserver ~]# chkconfig | grep td-hostserver
td-hostserver         0:off   1:off   2:off   3:off   4:off   5:off   6:off
[root@hostserver ~]# chkconfig td-hostserver on
[root@hostserver ~]# chkconfig | grep td-hostserver
td-hostserver         0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@hostserver ~]# chkconfig | grep httpd
httpd                 0:off   1:off   2:on    3:on    4:on    5:on    6:off

And in case of using a S3 compatible object store:

[root@hostserver ~]# chkconfig | grep s3d
s3d           0:off   1:off   2:on    3:on    4:on    5:on    6:off

Migrating an Older Host Server Version to a 3.6 Instance

Please contact TeamDrive Systems for further information.