[SOLVED] Issues with upgrade_6.2_6.3.sh (on 6.3.4, from 6.2.5)

Hi,

I’m finally want to update my old Seafile setup. So far it’s been running on 6.2.5 with Debian Bullseye. I’ve now checked out 6.3.4 from the sources and rebuild+installed it. I then wanted to run the upgrade scripts but already the first one, upgrade_6.2_6.3.sh, fails as follows:

seafile@seafile:~/build/seafile-server/src/seafile-server$ ./scripts/upgrade/upgrade_6.2_6.3.sh

-------------------------------------------------------------
This script would upgrade your seafile server from 6.2 to 6.3
Press [ENTER] to contiune
-------------------------------------------------------------



Updating seafile/seahub database ...

[INFO] You are using SQLite3
[INFO] updating seafile database...
[INFO] updating seahub database...
Traceback (most recent call last):
  File "/home/seafile/build/seafile-server/src/seafile-server/scripts/upgrade/db_update_helper.py", line 384, in <module>
    main()
  File "/home/seafile/build/seafile-server/src/seafile-server/scripts/upgrade/db_update_helper.py", line 379, in main
    db_updater.update_db()
  File "/home/seafile/build/seafile-server/src/seafile-server/scripts/upgrade/db_update_helper.py", line 275, in update_db
    super(SQLiteDBUpdater, self).update_db()
  File "/home/seafile/build/seafile-server/src/seafile-server/scripts/upgrade/db_update_helper.py", line 129, in update_db
    self.update_seahub_sql(seahub_sql)
  File "/home/seafile/build/seafile-server/src/seafile-server/scripts/upgrade/db_update_helper.py", line 299, in update_seahub_sql
    self.apply_sqls(self.seahub_db, sql_path)
  File "/home/seafile/build/seafile-server/src/seafile-server/scripts/upgrade/db_update_helper.py", line 289, in apply_sqls
    conn.execute(line)
sqlite3.OperationalError: no such table: main.notifications_notification

Failed to upgrade your database

Any idea how I’d best fix this?

Okay, found my issue (as I’ve also mentioned on Github for haiwen/seafile, #2082):

My slightly different INSTALL_PATH in the upgrade script unfortunately is not automatically propagated to scripts/upgrade/db_update_helper.py. So I had to modify that, too, like this:

seafile@seafile:~/build/seafile-server/src/seafile-server$ git diff
diff --git a/scripts/upgrade/db_update_helper.py b/scripts/upgrade/db_update_helper.py
index d38f727..b1f85a1 100644
--- a/scripts/upgrade/db_update_helper.py
+++ b/scripts/upgrade/db_update_helper.py
@@ -20,7 +20,8 @@ except ImportError:
 class EnvManager(object):
     def __init__(self):
         self.upgrade_dir = os.path.dirname(__file__)
-        self.install_path = os.path.dirname(self.upgrade_dir)
+        #self.install_path = os.path.dirname(self.upgrade_dir)
+        self.install_path = "/home/seafile/build/seafile-server"
         self.top_dir = os.path.dirname(self.install_path)
         self.ccnet_dir = os.environ['CCNET_CONF_DIR']
         self.seafile_dir = os.environ['SEAFILE_CONF_DIR']
diff --git a/scripts/upgrade/upgrade_6.2_6.3.sh b/scripts/upgrade/upgrade_6.2_6.3.sh
index a46c81e..21b3595 100755
--- a/scripts/upgrade/upgrade_6.2_6.3.sh
+++ b/scripts/upgrade/upgrade_6.2_6.3.sh
@@ -2,7 +2,8 @@
 
 SCRIPT=$(readlink -f "$0") # haiwen/seafile-server-1.3.0/upgrade/upgrade_xx_xx.sh
 UPGRADE_DIR=$(dirname "$SCRIPT") # haiwen/seafile-server-1.3.0/upgrade/
-INSTALLPATH=$(dirname "$UPGRADE_DIR") # haiwen/seafile-server-1.3.0/
+#INSTALLPATH=$(dirname "$UPGRADE_DIR") # haiwen/seafile-server-1.3.0/
+INSTALLPATH=/home/seafile/build/seafile-server/
 TOPDIR=$(dirname "${INSTALLPATH}") # haiwen/
 default_ccnet_conf_dir=${TOPDIR}/ccnet
 default_conf_dir=${TOPDIR}/conf

Now the script is happy :slight_smile: :

seafile@seafile:~/build/seafile-server/src/seafile-server$ ./scripts/upgrade/upgrade_6.2_6.3.sh

-------------------------------------------------------------
This script would upgrade your seafile server from 6.2 to 6.3
Press [ENTER] to contiune
-------------------------------------------------------------



Updating seafile/seahub database ...

[INFO] You are using SQLite3
[INFO] updating seafile database...
[INFO] updating seahub database...
Done

migrating avatars ...

Done

updating /home/seafile/build/seafile-server-latest symbolic link to /home/seafile/build/seafile-server/ ...



-----------------------------------------------------------------
Upgraded your seafile server successfully.
-----------------------------------------------------------------


1 Like