HowTo: Update Seafile Server for generic Linux to version 7.1.5 64bit

Seafile Server is an open source alternative to public cloud storage providers like Dropbox, Microsoft OneDrive, Apple iCloud, Google Drive and Citrix Sharefile. It works on free Linux Distributions like Debian and gives you the freedom to use the comfort of a modern synchronization client, the simplicity of a modern WebGUI, completed with the knowledge where your data is and who can access it.

Seafile Server for generic Linux 7.1.5 64bit

If you are searching for the update guide for Seafile 6.x to 7.0.x, please find the old article below. Thank you!

Changelog

  • 01.11.2020: Post updated for Seafile Server 7.1.5
  • 04.05.2020: Post updated for Seafile Server 7.1.3 and archived previous guide below, as it’s still relevant, if you want to upgrade from 6.x to 7.1.x
  • 24.12.2019: Post update for Seafile Server 7.0.5
    Reworked WordPress link structure, to point all update guides to a new static URL.


Since 22.09.2020 the fifth maintenance release version 7.1.5 is public available. Please see the official changelog:
https://download.seafile.com/published/seafile-manual/changelog/server-changelog.md

My Debian 10 GNU/Linux virtual machine:

  • Debian GNU/Linux 10.5 (buster) amd64
  • Apache 2.4 web server

Instructions

  1. You have to install new dependencies, due to the transition from Python 2 to Python 3, the following is for Debian 10 and Seafile Server community edition.
    apt install python3 python3-setuptools python3-pip -y
    
    pip3 install Pillow pylibmc captcha jinja2 sqlalchemy psd-tools django-pylibmc django-simple-captcha python3-ldap
  2. Switch to the install path of your Seafile installation:
    cd /opt/seafile
  3. Make yourself familiar with your folder layout structure. For me it’s organized in /opt/seafile:
    root@debian:/opt/seafile# tree -d -L 2 /opt/seafile/
    /opt/seafile/
    ├── ccnet
    │   └── misc
    ├── certificates
    ├── conf
    ├── logs
    ├── pids
    ├── seafile-data
    │   ├── commits
    │   ├── fs
    │   ├── httptemp
    │   ├── library-template
    │   ├── storage
    │   └── tmpfiles
    ├── seafile-server-6.3.4
    │   ├── runtime
    │   ├── seafile
    │   ├── seahub
    │   └── upgrade
    ├── seafile-server-7.0.5
    │   ├── runtime
    │   ├── seafile
    │   ├── seahub
    │   ├── sql
    │   └── upgrade
    ├── seafile-server-latest -> seafile-server-6.3.4
    └── seahub-data
        ├── avatars
        └── thumbnail
  4. Download the latest version:
    wget https://s3.eu-central-1.amazonaws.com/download.seadrive.org/seafile-server_7.1.5_x86-64.tar.gz
  5. Unpack the archive:
    tar -xzf seafile-server_7.1.5_x86-64.tar.gz
  6. The directory listing should look similar to this example:
    root@debian:/opt/seafile# tree -d -L 2 /opt/seafile/
    /opt/seafile/
    ├── ccnet
    │   └── misc
    ├── certificates
    ├── conf
    ├── logs
    ├── pids
    ├── seafile-data
    │   ├── commits
    │   ├── fs
    │   ├── httptemp
    │   ├── library-template
    │   ├── storage
    │   └── tmpfiles
    ├── seafile-server-7.1.3
    │   ├── runtime
    │   ├── seafile
    │   ├── seahub
    │   ├── sql
    │   └── upgrade
    ├── seafile-server-7.1.5
    │   ├── runtime
    │   ├── seafile
    │   ├── seahub
    │   ├── sql
    │   └── upgrade
    ├── seafile-server-latest -> seafile-server-7.1.3
    └── seahub-data
        ├── avatars
        └── thumbnail
  7. Stop the services before the update.
    systemctl stop seafile-server
  8. List the available update scripts:
    root@debian:/opt/seafile# ls -1h ./seafile-server-7.1.5/upgrade/
    add_collate.sh
    db_update_1.3_1.4.py
    db_update_helper.py
    fix_mysql_user.py
    minor-upgrade.sh
    regenerate_secret_key.sh
    sql
    upgrade_1.2_1.3.sh
    upgrade_1.3_1.4.sh
    upgrade_1.4_1.5.sh
    upgrade_1.5_1.6.sh
    upgrade_1.6_1.7.sh
    upgrade_1.7_1.8.sh
    upgrade_1.8_2.0.sh
    upgrade_2.0_2.1.sh
    upgrade_2.1_2.2.sh
    upgrade_2.2_3.0.sh
    upgrade_3.0_3.1.sh
    upgrade_3.1_4.0.sh
    upgrade_4.0_4.1.sh
    upgrade_4.1_4.2.sh
    upgrade_4.2_4.3.sh
    upgrade_4.3_4.4.sh
    upgrade_4.4_5.0.sh
    upgrade_5.0_5.1.sh
    upgrade_5.1_6.0.sh
    upgrade_6.0_6.1.sh
    upgrade_6.1_6.2.sh
    upgrade_6.2_6.3.sh
    upgrade_6.3_7.0.sh
    upgrade_7.0_7.1.sh
    win32
  9. Decide whether you have to perform a major upgrade (7.0.x to 7.1.x) or a minor upgrade (7.1.x to 7.1.x):
    1. The update from 7.0.x to 7.1.x is a major version upgrade, so we have to use the upgrade_7.0_7.1.sh script:
      root@debian:/opt/seafile# ./seafile-server-7.1.5/upgrade/upgrade_7.0_7.1.sh
      
      -------------------------------------------------------------
      This script would upgrade your seafile server from 7.0 to 7.1
      Press [ENTER] to contiune
      -------------------------------------------------------------
      
      renaming the gunicorn.conf to gunicorn.conf.py ...
      
      Done
      
      Updating seafile/seahub database ...
      
      [INFO] You are using MySQL
      [INFO] updating seahub database...
      /opt/seafile/seafile-server-7.1.5/seahub/thirdpart/pymysql/cursors.py:170: Warning: (1050, "Table 'base_reposecretkey' already exists")
        result = self._query(query)
      [WARNING] Failed to execute sql: (1091, "Can't DROP INDEX `drafts_draft_origin_file_uuid_7c003c98_uniq`; check that it exists")
      Done
      
      migrating avatars ...
      
      Done
      
      updating /opt/seafile/seafile-server-latest symbolic link to /opt/seafile/seafile-server-7.1.5 ...
      
      -----------------------------------------------------------------
      Upgraded your seafile server successfully.
      -----------------------------------------------------------------
    2. The update from 7.1.x to 7.1.5 is a minor version upgrade, so we have to use the minor-upgrade.sh script:
      root@debian:/opt/seafile# ./seafile-server-7.1.5/upgrade/minor-upgrade.sh
      
      -------------------------------------------------------------
      This script would do the minor upgrade for you.
      Press [ENTER] to contiune
      -------------------------------------------------------------
      
      renaming the gunicorn.conf to gunicorn.conf.py ...
      
      Done
      
      ------------------------------
      migrating avatars ...
      
      DONE
      ------------------------------
      
      Moving the elasticsearch's configuration file ...
      
      updating seafile-server-latest symbolic link to /opt/seafile/seafile-server-7.1.5 ...
      
      DONE
      ------------------------------

       

  10. Revise the file system permissions:
    chown seafile:root /opt/seafile/ -R
  11. Clear the Seahub cache:
    rm -rf /tmp/seahub_cache
    systemctl restart memcached
  12. Before we can start Seafile server again, we have to check the memchached configuration for seahub:
    nano /opt/seafile/conf/seahub_settings.py
    
    Change this line:
    'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
    
    To this line:
    'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
  13. Start the services:
    systemctl start seafile-server

Thank you for reading my blog and I hope I could help someone out there!

Source

https://download.seafile.com/published/seafile-manual/upgrade/upgrade.md
https://download.seafile.com/published/seafile-manual/upgrade/upgrade_notes_for_7.1.x.md


Archive: Update Seafile Server for generic Linux to version 7.0.5 64bit

Since 23.09.2019 the fifth maintenance release version 7.0.5 is public available.

My Debian 9 GNU/Linux virtual machine:

  • Debian GNU/Linux 9.11 (stretch) amd64
  • Apache 2.4 web server
  1. Switch to the install path of your Seafile installation:
    cd /opt/seafile
  2. Make yourself familiar with your folder layout structure. For me it’s organized in /opt/seafile:
    root@debian:/opt/seafile# tree -d -L 2 /opt/seafile/
    /opt/seafile/
    ├── ccnet
    │   └── misc
    ├── certificates
    ├── conf
    ├── logs
    ├── pids
    ├── seafile-data
    │   ├── commits
    │   ├── fs
    │   ├── httptemp
    │   ├── library-template
    │   ├── storage
    │   └── tmpfiles
    ├── seafile-server-6.2.5
    │   ├── runtime
    │   ├── seafile
    │   ├── seahub
    │   └── upgrade
    ├── seafile-server-6.3.4
    │   ├── runtime
    │   ├── seafile
    │   ├── seahub
    │   └── upgrade
    ├── seafile-server-latest -> seafile-server-6.3.4
    └── seahub-data
        ├── avatars
        └── thumbnail
    
    1. Download the latest version:
      wget https://download.seadrive.org/seafile-server_7.0.5_x86-64.tar.gz
  3. Unpack the archive:
    tar -xzf seafile-server_7.0.5_x86-64.tar.gz
  4. The directory listing should look similar to this example:
    root@debian:/opt/seafile# tree -d -L 2 /opt/seafile/
    /opt/seafile/
    ├── ccnet
    │   └── misc
    ├── certificates
    ├── conf
    ├── logs
    ├── pids
    ├── seafile-data
    │   ├── commits
    │   ├── fs
    │   ├── httptemp
    │   ├── library-template
    │   ├── storage
    │   └── tmpfiles
    ├── seafile-server-6.3.4
    │   ├── runtime
    │   ├── seafile
    │   ├── seahub
    │   └── upgrade
    ├── seafile-server-7.0.5
    │   ├── runtime
    │   ├── seafile
    │   ├── seahub
    │   ├── sql
    │   └── upgrade
    ├── seafile-server-latest -> seafile-server-6.3.4
    └── seahub-data
        ├── avatars
        └── thumbnail
  5. Stop the services before the update.
    systemctl stop seafile-server
  6. List the available update scripts:
    root@debian:/opt/seafile# ls -1h ./seafile-server-7.0.5/upgrade/
    add_collate.sh
    db_update_1.3_1.4.py
    db_update_helper.py
    fix_mysql_user.py
    minor-upgrade.sh
    regenerate_secret_key.sh
    sql
    upgrade_1.2_1.3.sh
    upgrade_1.3_1.4.sh
    upgrade_1.4_1.5.sh
    upgrade_1.5_1.6.sh
    upgrade_1.6_1.7.sh
    upgrade_1.7_1.8.sh
    upgrade_1.8_2.0.sh
    upgrade_2.0_2.1.sh
    upgrade_2.1_2.2.sh
    upgrade_2.2_3.0.sh
    upgrade_3.0_3.1.sh
    upgrade_3.1_4.0.sh
    upgrade_4.0_4.1.sh
    upgrade_4.1_4.2.sh
    upgrade_4.2_4.3.sh
    upgrade_4.3_4.4.sh
    upgrade_4.4_5.0.sh
    upgrade_5.0_5.1.sh
    upgrade_5.1_6.0.sh
    upgrade_6.0_6.1.sh
    upgrade_6.1_6.2.sh
    upgrade_6.2_6.3.sh
    upgrade_6.3_7.0.sh
    win32
  7. The update from 6.3.x to 7.0.x is a major version update, so have to use the upgrade_6.3_7.0.sh script:
    root@debian:/opt/seafile# ./seafile-server-7.0.5/upgrade/upgrade_6.3_7.0.sh
    -------------------------------------------------------------
    This script would upgrade your seafile server from 6.3 to 7.0
    Press [ENTER] to contiune
    -------------------------------------------------------------
    Updating seafile/seahub database ...
    
    [INFO] You are using MySQL
    [INFO] updating ccnet database...
    [INFO] updating seafile database...
    [INFO] updating seahub database...
    [WARNING] Failed to execute sql: (1146, "Table 'seafile_seahub-db.TotalStorageStat' doesn't exist")
    [WARNING] Failed to execute sql: (1146, "Table 'seafile_seahub-db.TotalStorageStat' doesn't exist")
    [WARNING] Failed to execute sql: (1146, "Table 'seafile_seahub-db.TotalStorageStat' doesn't exist")
    [WARNING] Failed to execute sql: (1146, "Table 'seafile_seahub-db.TotalStorageStat' doesn't exist")
    [WARNING] Failed to execute sql: (1146, "Table 'seafile_seahub-db.FileOpsStat' doesn't exist")
    [WARNING] Failed to execute sql: (1146, "Table 'seafile_seahub-db.FileOpsStat' doesn't exist")
    [WARNING] Failed to execute sql: (1146, "Table 'seafile_seahub-db.UserActivityStat' doesn't exist")
    [WARNING] Failed to execute sql: (1146, "Table 'seafile_seahub-db.UserActivityStat' doesn't exist")
    [WARNING] Failed to execute sql: (1146, "Table 'seafile_seahub-db.UserActivityStat' doesn't exist")
    [WARNING] Failed to execute sql: (1146, "Table 'seafile_seahub-db.UserActivityStat' doesn't exist")
    [WARNING] Failed to execute sql: (1146, "Table 'seafile_seahub-db.UserActivityStat' doesn't exist")
    [WARNING] Failed to execute sql: (1051, "Unknown table 'seafile_seahub-db.UserTrafficStat'")
    [WARNING] Failed to execute sql: (1091, "Can't DROP 'profile_profile_contact_email_0975e4bf_uniq'; check that column/key exists")
    Done
    
    migrating avatars ...
    
    Done
    
    updating /opt/seafile/seafile-server-latest symbolic link to /opt/seafile/seafile-server-7.0.5 ...
    
    -----------------------------------------------------------------
    Upgraded your seafile server successfully.
    -----------------------------------------------------------------
    

    Caution: There is a bug in the update script upgrade_6.3_7.0.sh. It doesn’t distinguish between the community and pro version anymore, hence the errors above. These errors are no problem, if you use the community edition, because they don’t account to that version.
    Source: https://forum.seafile.com/t/got-mysql-warnings-when-upgraded-from-6-3-to-7-0/9122/4

  8. Revise the file system permissions:
    chown seafile:root /opt/seafile/ -R
  9. Before we can start seafile again, we have to check the init script and the apache.conf:

    From 6.3, With this upgrade, the fast-cgi mode is no longer supported. You need to config Seafile behind Nginx/Apache in WSGI mode. Two steps are needed to switch to WSGI mode:

    1. Change the config file of Nginx/Apache.
    2. Restart Seahub with ./seahub.sh start instead of ./seahub.sh start-fastcgi
  10. First let’s check the init script:
    nano /etc/init.d/seafile-server
    
    # Change the value of fastcgi to true if fastcgi is to be used
    fastcgi=false
  11. And second edit the corresponding apache.conf:
    nano /etc/apache2/sites-available/files.meinekleinefarm.net.conf
    # seahub 6.1
    #SetEnvIf Request_URI . proxy-fcgi-pathinfo=unescape
    #SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    #ProxyPass / fcgi://127.0.0.1:8000/
    
    # seahub 6.2
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    ProxyPass / http://127.0.0.1:8000/
    ProxyPassReverse / http://127.0.0.1:8000/
  12. Reload the apache.conf:
    systemctl reload apache2
  13. Start the services:
    systemctl start seafile-server

Thank you for reading my blog and I hope I could help someone out there!

Source: http://manual.seafile.com/deploy/upgrade.html

Author: Marco

Marco is an IT-System administrator and IT-Consultant with 10+ years experience. He is specialized in the delivery of virtual Apps and Desktops with Citrix solutions. In 2017 he has been awarded Citrix Technology Advocate by Citrix for his community work (#CTA). His second core area is availability & performance monitoring with Zabbix, a leading open-source solution. His employer is the German IT-Company ANAXCO, which is developing a Transport Management Software (TMS) based on Microsoft Dynamics AX. More about Marco

One thought on “HowTo: Update Seafile Server for generic Linux to version 7.1.5 64bit”

  1. Hello,

    Thank you for your blog. It helps me a lot !!!
    I was blocked into my migration from CE 7.05 to 7.1 and thanks to your 2 first lines about python solve my problem.
    The memchached configuration for seahub was already with the good value for me.
    Now I’ve to follow to migrate to the professional version.
    Thanks for your share

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.