Ryan Wang 🚀 备份原有的 MySQL 数据 mysqldump --opt -hlocalhost -uroot -p<PASSWORD> --skip-lock-tables halobbs>halobbs.sql 创建数据目录 mkdir flarum 整理插件数据,将原有 composer.json 中的插件整理为如下形式的文本并添加到 flarum/extensions/list: afrux/forum-stats-widget:* afrux/forum-widgets-core:* afrux/online-users-widget:* afrux/top-posters-widget:* archlinux-de/flarum-discussion-feed:^1.0 askvortsov/flarum-markdown-tables:* clarkwinkelmann/flarum-ext-circle-groups:^1.0 clarkwinkelmann/flarum-ext-emojionearea:* clarkwinkelmann/flarum-ext-scout:^0.1.1 darkle/fancybox:^0.2.0 flarum-lang/chinese-simplified:^1.0 fof/best-answer:1.0.1 fof/drafts:* fof/github-autolink:* fof/links:* fof/merge-discussions:* fof/oauth:* fof/reactions:* fof/sitemap:* fof/socialprofile:* fof/split:* fof/user-bio:* ianm/follow-users:^1.0 ianm/html-head:^1.0 luceos/flarum-ext-staff-badge:^0.1.0 swaggymacro/only-starter:^0.6.1 sycho/discussion-canonical-url:* sycho/flarum-advanced-extension-categories:^0.1.3 sycho/flarum-github-milestone:^0.1.2 v17development/flarum-seo:* 编写 docker-compose.yaml 文件 version: "3" services: flarum_server: image: mondedie/flarum:stable container_name: flarum_server env_file: - ./flarum.env volumes: - ./assets:/flarum/app/public/assets - ./extensions:/flarum/app/extensions - ./storage/logs:/flarum/app/storage/logs - ./nginx:/etc/nginx/flarum ports: - 8000:8888 depends_on: - flarum_db networks: flarum_network: flarum_db: image: mariadb:10.5 container_name: flarum_db environment: - MYSQL_ROOT_PASSWORD=<ROOT_PASSWORD> - MYSQL_DATABASE=flarum - MYSQL_USER=flarum - MYSQL_PASSWORD=<FLARUM_DB_PASSWORD> volumes: - ./db:/var/lib/mysql networks: flarum_network: flarum_search_engine: image: getmeili/meilisearch:latest container_name: flarum_search_engine restart: always volumes: - ./meili_data:/meili_data environment: - MEILI_MASTER_KEY=<KEY> networks: flarum_network: networks: flarum_network: 编写 flarum.env 文件 DEBUG=false FORUM_URL=https://bbs.halo.run # Database configuration DB_HOST=flarum_db DB_NAME=flarum DB_USER=flarum DB_PASS=<FLARUM_DB_PASSWORD> DB_PREF= DB_PORT=3306 # User admin flarum (environment variable for first installation) # /!\ admin password must contain at least 8 characters /!\ FLARUM_ADMIN_USER=ryanwang FLARUM_ADMIN_PASS=xxxxxxxxxx FLARUM_ADMIN_MAIL=i@ryanc.cc FLARUM_TITLE=Halo 社区 迁移原有的 assets 文件,将原来目录的 public/assets/avatars 复制到 flarum/assets/avatars。 尝试启动容器 docker-compose up -d 恢复 MySQL 数据。 docker exec -i flarum_db sh -c 'exec mysql -uflarum -p<FLARUM_DB_PASSWORD>' < ./halobbs.sql 重新创建所有容器。 docker-compose down docker-compose up -d 登录后台重启所有插件。 目前有一个小问题,重新创建容器之后因为需要重新安装所有插件,会导致重建之后需要手动去启用所有插件,详见:mondediefr/docker-flarum81