seafile6.2.3 sqlite如何迁移至mysql

-- coding: utf-8 --

SECRET_KEY = “k78sl7rn_jlo%k!_arjl%01h-mja@*3)#o#4f+tbnf1sb_0)$r”

Enable Only Office

ENABLE_ONLYOFFICE = True
VERIFY_ONLYOFFICE_CERTIFICATE = False
ONLYOFFICE_APIJS_URL = ‘http://192.168.1.8:8889/web-apps/apps/api/documents/api.js’ #这里改成onlyoffice的地址+端口 http://192.168.1.8:8889
ONLYOFFICE_FILE_EXTENSION = (‘doc’, ‘docx’, ‘ppt’, ‘pptx’, ‘xls’, ‘xlsx’, ‘odt’, ‘fodt’, ‘odp’, ‘fodp’, ‘ods’, ‘fods’)
ONLYOFFICE_EDIT_FILE_EXTENSION = (‘doc’,‘docx’,‘pptx’,‘xls’,‘xlsx’)

DATABASES = {
‘default’: {
‘ENGINE’: ‘django.db.backends.mysql’,
‘USER’ : ‘root’,
‘PASSWORD’ : ‘fljg10018’,
‘NAME’ : ‘seahub-db’,
‘HOST’ : ‘127.0.0.1’,
‘OPTIONS’: {
“init_command”: “SET storage_engine=INNODB”,
}
}
}

DATABASES是复制官网?还是自己手输入的? 试一下复制官网的,注意把DATABASES前面的空格删除才行。
https://cloud.seafile.com/published/seafile-manual-cn/deploy/migrate_from_sqlite_to_mysql.md

从上面报错看来问题应该是跟数据库有关,配置或者数据库里的数据。

数据库是离线安装的MYSQL5.7.10,数据库软件连接正常,导入sql脚本报错也只是提示值重复的报错。
DATABASES信息确定是官方复制了,看来具体问题是不太好找了。 :joy:

pymysql 看下安装了吗

请问有适合6.2.3适用的mysql带pymysql的安装方式吗,目前mysql为手动安装,Python 版本为2.7,无法安装pymysql

安装pymysql之后,启动 ./seahub.sh start-fastcgi 的报错

[root@localhost seafile-server]# ./seahub.sh start-fastcgi

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub (fastcgi) at 127.0.0.1:8000 …
Traceback (most recent call last):
File “/home/MyCloud/seafile-server/seahub/manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/home/MyCloud/seafile-server/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/MyCloud/seafile-server/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/core/management/init.py”, line 328, in execute
django.setup()
File “/home/MyCloud/seafile-server/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/init.py”, line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File “/home/MyCloud/seafile-server/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/apps/registry.py”, line 85, in populate
app_config = AppConfig.create(entry)
File “/home/MyCloud/seafile-server/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/apps/config.py”, line 86, in create
module = import_module(entry)
File “/home/MyCloud/seafile-server/seahub/thirdpart/importlib-1.0.4-py2.6.egg/importlib/init.py”, line 37, in import_module
import(name)
File “/home/MyCloud/seafile-server/seahub/seahub/contacts/init.py”, line 3, in
from handlers import *
File “/home/MyCloud/seafile-server/seahub/seahub/contacts/handlers.py”, line 4, in
from models import Contact
File “/home/MyCloud/seafile-server/seahub/seahub/contacts/models.py”, line 54, in
class Contact(models.Model):
File “/home/MyCloud/seafile-server/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/base.py”, line 139, in new
new_class.add_to_class(’_meta’, Options(meta, **kwargs))
File “/home/MyCloud/seafile-server/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/base.py”, line 324, in add_to_class
value.contribute_to_class(cls, name)
File “/home/MyCloud/seafile-server/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/models/options.py”, line 250, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File “/home/MyCloud/seafile-server/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/init.py”, line 36, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item)
File “/home/MyCloud/seafile-server/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/utils.py”, line 241, in getitem
backend = load_backend(db[‘ENGINE’])
File “/home/MyCloud/seafile-server/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/utils.py”, line 130, in load_backend
raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: ‘django.db.backends.mysql’ isn’t an available database backend.
Try using ‘django.db.backends.XXX’, where XXX is one of:
u’base’, u’oracle’, u’postgresql_psycopg2’, u’sqlite3’
Error was: No module named mysql.base
Error:Seahub failed to start.

seahub_settings.py
将‘ENGINE’的值改为’django.db.backends.mysql’