DB Migration failes

Hello. I tried to update my linux seafile server from 6.1.1 to 6.2.3.
When running the db migration, I get an error:

Operations to perform:
Synchronize unmigrated apps: wiki, help, api2, share, statici18n, registration, trusted_ip, group, contacts, thumbnail, notifications, profile, gunicorn, tags, staticfiles, compressor, base, revision_tag, wopi, two_factor, messages, constance, password_session, avatar, options
Apply all migrations: termsandconditions, sessions, database, admin_log, invitations, captcha, contenttypes, role_permissions, post_office, institutions
Synchronizing apps without migrations:
Creating tables…
Running deferred SQL…
Installing custom SQL…
Running migrations:
Rendering model states… DONE
Applying admin_log.0001_initial…

stderr: Traceback (most recent call last):
File “/home/seafile/my.org/seafile-server-latest/seahub/manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/management/init.py”, line 354, in execute_from_command_line
utility.execute()
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/management/init.py”, line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/management/base.py”, line 394, in run_from_argv
self.execute(*args, **cmd_options)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/management/base.py”, line 445, in execute
output = self.handle(*args, **options)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/management/commands/syncdb.py”, line 25, in handle
call_command(“migrate”, **options)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/management/init.py”, line 120, in call_command
return command.execute(*args, **defaults)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/management/base.py”, line 445, in execute
output = self.handle(*args, **options)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/management/commands/migrate.py”, line 222, in handle
executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/migrations/executor.py”, line 110, in migrate
self.apply_migration(states[migration], migration, fake=fake, fake_initial=fake_initial)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/migrations/executor.py”, line 148, in apply_migration
state = migration.apply(state, schema_editor)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/migrations/migration.py”, line 115, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/migrations/operations/models.py”, line 59, in database_forwards
schema_editor.create_model(model)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/base/schema.py”, line 286, in create_model
self.execute(sql, params or None)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/base/schema.py”, line 111, in execute
cursor.execute(sql, params)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py”, line 64, in execute
return self.cursor.execute(sql, params)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/utils.py”, line 98, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py”, line 62, in execute
return self.cursor.execute(sql)
File “/home/seafile/my.org/seafile-server-latest/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/mysql/base.py”, line 124, in execute
return self.cursor.execute(query, args)
File “/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py”, line 226, in execute
self.errorhandler(self, exc, value)
File “/usr/lib/python2.7/dist-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorvalue
django.db.utils.OperationalError: (1050, “Table ‘admin_log_adminlog’ already exists”)

any idea howto fix that?

Did you run step by step migration/upgrade scripts? you should run minor_upgrade.sh for upgrade from 6.1.1 to 6.1.2 and then upgrade_6.1_6.2.sh to upgrade from 6.1.2 to 6.2.0 and then again minor_upgrade.sh for 6.2.0 to 6.2.3.

I’m not sure(and don’t have time to check it) how minor_upgrade.sh works but I’m pretty sure that you just forgot some upgrade script and now it’s throwing errors about mission table in DB