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.

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 usually require changes to the MySQL table structures. These changes need to be applied manually prior to starting the services 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.

In-place Upgrading to a newer version

Note

To enable the a newer TeamDrive Hosting Server yum repository, you need to download the updated td-hostserver.repo file and place it into the directory /etc/yum.repos.d/, e.g. by using wget:

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

The use of RPM packages makes updating from one build to another a fairly straightforward and automatic process.

The overall procedure is similar in all cases — we’ll remove the old software components while retaining the MySQL databases and configuration files, install the current versions of the Hosting Server RPM packages and and manually migrate the database to the new version by performing the following steps:

  • Stop the Apache HTTP Server and td-hostserver service (in case of using a S3 compatible object store stop the s3d service)
  • Perform a backup of the Hosting Server’s MySQL Databases
  • Install the new Hosting Server RPM package td-hostserver
  • Perform necessary conversions of the MySQL table structures using the command line tool yvva
  • Start the TeamDrive Hosting Server background service td-hostserver and Apache http Server (in case of using a S3 compatible object store start the s3d service), check the log files for any errors

The following paragraphs explain these steps in more detail.

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

Follow now the steps in the next chapter to stop the services, execute the database update and start the services again.

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

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 ~]# systemctl stop httpd

Next, stop the TeamDrive Hosting Service:

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

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

[root@hostserver ~]# systemctl stop s3d

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 > backup.sql

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 \
https://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.

Step 4) Update the database

To view the databases changes and start the database update use the command:

[root@hostserver ~]# yvva

The upgrade commands will be listed:

UPGRADE COMMANDS:
-----------------
To upgrade from the command line, execute:
yvva --call=upgrade_now --config-file="/etc/yvva.conf"

print_changes;;
Print a list of changes will be performed when you run 'upgrade_now'.

upgrade_now;;
Perform upgrade changes to the database (this command cannot be undone).

Type in print_changes;; to view the list of changes and start the update with upgrade_now;;.

You will get the output:

Upgrade in progress...

Upgrade completed successfully.

Exit yvva with quit.

Change the mysql authentication from the old mysql_native_password, which is depreacted, to the new caching_sha2_password. To check if you have to change the authentication, open the /var/lib/mysql/mysqld.log file and search for this warning:

[Warning] [MY-013360] [Server] Plugin mysql_native_password reported:
''mysql_native_password' is deprecated and will be removed in a future
release. Please use caching_sha2_password instead'

Login with the root user to MySQL:

[root@hostserver ~]# mysql -u root -p

and execute (replace <password> with the teamdrive mysql password –> see /etc/td-regserver.my.cnf):

mysql> alter user teamdrive@localhost identified with caching_sha2_password by '<password>';

Step 5) Start the Host Server Components

Now start the TeamDrive Hosting Service:

[root@hostserver ~]# systemctl start td-hostserver
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 ~]# systemctl start httpd
Starting httpd:                                            [  OK  ]

Check the log files for any errors:

[root@hostserver ~]# less /var/log/httpd/error_log
[root@hostserver ~]# less /var/log/mod_pspace.log

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

[root@hostserver ~]# systemctl start s3d
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@regserver ~]# systemctl enable td-hostserver
[root@regserver ~]# systemctl enable httpd

And in case of using a S3 compatible object store:

[root@hostserver ~]# systemctl enable s3d

Migrate to a newer version on new server

Migrating a server to a new instance is similar to the in-place upgrade described above.

Follow the above steps for 1) Stop the TeamDrive Services and 2) Create a MySQL Backup. Unmount the /spacedata-Volume, move the volume to the new server and mount the volume at the same location under /spacedata. Then reboot the server. If moving the volume to the new server is not possible, the data must alternatively be copied to the new server using scp or rsync. This method should also be used if the volume is to be increased during the move. Copy your ssl certificates and the database backup to the new instance and import the database with:

[root@regserver ~]# mysql -u root -p < backup.sql

On the new instance, store the SSL certificates in the same location as on the previous server and update the settings in /etc/httpd/conf.d/ssl.conf for SSLCertificateFile, SSLCertificateKeyFile and SSLCACertificateFile as on the previous server.

Execute 4) Update the database to upgrade the database to the current version.

Follow the above 5) Start the Host Server Components on the new instance and check the log files for errors.

In the last step, transfer the IP address from the old instance to the new one and adjust your external firewall if necessary.