Posted in Linux
Migrate Seafile ke Server Lain
Asumsi pada artikel ini:
- Folder haiwen ada pada /opt
- Nginx digunakan untuk fast-cgi
- Server asal ada di IP 1.1.1.1
- Server tujuan ada di IP 2.2.2.2
- SSH ada di port 22
- Email myemail@notulensiku.com
- Domain data.notulensiku.com
- Pastikan selinux berada pada posisi permissive atau disabled
Berikut adalah perintah yang digunakan:
yum install python python-setuptools python-imaging python-ldap python-memcached MySQL-python python-urllib3 rsync -avzhe 'ssh -p 22' /opt/haiwen root@2.2.2.2:/opt rsync -avzhe 'ssh -p 22' /etc/nginx/ root@2.2.2.2:/etc/nginx/ screen cd /etc/ssl/certs openssl dhparam -out dhparam.pem 4096 # Tekan ctrl + a + d cd /opt # Change all DNS to 2.2.2.2 # install letsencrypt client cd /opt/ mkdir letsencrypt cd letsencrypt/ wget https://dl.eff.org/certbot-auto chmod a+x ./certbot-auto # Get cert for data.notulensiku.com systemctl stop nginx ./certbot-auto certonly --standalone --email myemail@notulensiku.com -d data.notulensiku.com systemctl start nginx systemctl enable nginx
Edit credential database di /opt/haiwen/conf/ccnet.conf
ENGINE = mysql HOST = 127.0.0.1 PORT = 3306 USER = userDB PASSWD = PassDB DB = seafile_ccnet CONNECTION_CHARSET = utf8
Edit database di /opt/haiwen/conf/seafile.conf
type = mysql host = 127.0.0.1 port = 3306 user = userDB password = PassDB db_name = seafile_db connection_charset = utf8
Edit database di /opt/haiwen/conf/seahub_settings.py
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'seafile_seahub', 'USER': 'UserDB', 'PASSWORD': 'PassDB', 'HOST': '127.0.0.1', 'PORT': '3306', 'OPTIONS': { 'init_command': 'SET storage_engine=INNODB', } } }
Ketika ada eror python, cek di sini. Jika tetap eror karena NFS server dan ada di VM LXC, cek di sini.
Jika ada eror