Here is what you do, follow these steps and you will succeed, if you have any questions please leave a comments.
Step 1:
Use Yunohost webmin- applications - install an app to install flarum
Step 2:
Make a copy and back up for the flarum site and flarum3 site. So if anything goes wrong, you still can restore them.
Step 3:
Download "composer.json" and "config.php" from /var/www/flarum3, and "composer.json" from /var/www/flarum. You will need the details in these files for later steps.
Step 4:
Compress public folder from /var/www/flarum and uncompress it to check if you any files or folders from it.
Step 5:
Connect your Yunohost sever. These following steps may not be ideal, but it worked. If you have better solutions/practices, please let me know.
a. 'sudo su' to get the access you may need.
b. Go to the right folder cd /var/www
c. Check the folder name of flarum site:
/var/www# ls
flarum flarum2 flarum3
d. Let get started:
root@grace:/var/www# cd flarum__3`
root@grace:/var/www/flarum__3# ls
CHANGELOG.md composer.json composer.lock composer.phar config.php extend.php flarum LICENSE public README.md site.php storage vendor
root@grace:/var/www/flarum__3# mv vendor vendor_old
root@grace:/var/www/flarum__3# cp -r /var/www/flarum/vendor /var/www/flarum__3/vendor
root@grace:/var/www/flarum__3# nano composer.json
Use deepseek to ask it to "combine the two require sections, adding the require section of flarum 'composer.json' into require section of flarum__3 'composer.json'". Then save the file.
Step 6:
Delete flarum3 database TABLES, NOT the database as a whole, you will need the database credential. (Disable foreign key constraints). Export flarum database, and import it to flarum3.
--- backup
In Yunohost, for the new site to work, firstly, you need to fix the ownership and permissions of the vendor folder for the flarum__3 site.
List the ownership and permissions of the vendor_old and ask the deepseek for the command to fix the vendor folder accordingly.
root@grace:/var/www/flarum__3# ls -la /var/www/flarum__3/vendor_old
root@grace:/var/www/flarum__3# ls -la /var/www/flarum__3/vendor
Do a backup before you do anything. Then follow what deepseek suggested:
This is what deepseek tells me:
Permission Status Comparison
📊 Permission Status Comparison Table
| Item | Correct Permissions (Reference) | Current Permissions (Problem State) | Status |
|------|----------------------------------|-------------------------------------|--------|
| Current Directory | 770 (drwxrwx---)<br>flarum__3:www-data | 750 (drwxr-x---)<br>root:root | ❌ Critical Issue |
| Parent Directory | 750 (drwxr-x---)<br>flarum__3:www-data | 750 (drwxr-x---)<br>flarum__3:www-data | ✅ Correct |
| autoload.php | 660 (-rw-rw----)<br>flarum__3:www-data | 640 (-rw-r-----)<br>root:root | ❌ Critical Issue |
| All Extension Directories<br>(106 directories) | 770 (drwxrwx---)<br>flarum__3:www-data | 750 (drwxr-x---)<br>root:root | ❌ Critical Issue |
🔴 Critical Issues Summary
1. Complete Ownership Error
- Correct:
flarum__3:www-data
- Current:
root:root (106 out of 107 items)
2. Incorrect Permission Settings
- Directory permissions: 770 → 750 (missing group write permission)
- File permissions: 660 → 640 (missing group read permission)
3. Impact Scope
- 106 directories: Wrong ownership and permissions
- 1 file: Wrong ownership and permissions
- Only 1 parent directory: Correct permissions
🚨 Emergency Fix Commands
# Navigate to directory
cd /var/www/flarum__3/vendor
# 1. Fix ownership (root → flarum__3)
sudo chown -R flarum__3:www-data .
# 2. Fix directory permissions (750 → 770)
sudo find . -type d -exec chmod 770 {} \;
# 3. Fix file permissions (640 → 660)
sudo find . -type f -exec chmod 660 {} \;
# 4. Special handling for parent directory (keep 750)
sudo chmod 750 ..
⚠️ Problem Impact
Current state will cause:
- Flarum cannot run - Web server cannot access vendor files
- 500 Error - PHP cannot load dependencies
- Extensions failure - All extensions cannot work properly
After repair:
- Web server normal access - nginx/PHP-FPM can read/write vendor
- Flarum normal operation - All dependencies load correctly
- Extension functionality restored - BBCode, upload and other functions work normally
Execute repair commands immediately, otherwise Flarum will not function properly!
In the end:
sudo yunohost app shell flarum__3
# Will load Flarum's environment in a new shell
php composer.phar update --prefer-dist --no-plugins --no-dev -a --with-all-dependencies
php flarum migrate
php flarum cache:clear
exit
Everything should be fine. Good luck.