# Mastodon restore from backup fails - Could not find 'bundler'

**URL:** https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421
**Category:** Support apps
**Tags:** mastodon, english
**Created:** [June 9, 2026, 12:45pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421 "2026-06-09T12:45:31Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![mossy](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mossy/32/13675_2.png) [@mossy](https://forum.yunohost.org/u/mossy)
#### Post date: [June 9, 2026, 12:45pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/1 "2026-06-09T12:45:31Z")

</div>

**What app is this about, and its version** : Mastodon v4.3.6  
**What YunoHost version are you running** : 12.1.40.1  
**What type of hardware are you using** : Other ARM board

### Describe your issue

Upgrading Mastodon failed, so I tried to restore from a backup, but now I can’t get that to work

It says:  
`To install the version of bundler this project requires, run gem install bundler -v '~> 2.6'`

But gem is installed with Mastodon, and deleted when the backup restore fails, so I never have a chance to run that

Any help would be much appreciated

### Share relevant logs or error messages

paste (dot) yunohost (dot) org/raw/ejitikihan

(New users apparently can’t post links)

---

<div class="post-metadata">

### Author: ![JfmbLinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/jfmblinux/32/11238_2.png) [@JfmbLinux](https://forum.yunohost.org/u/JfmbLinux)
#### Post date: [June 9, 2026, 7:21pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/2 "2026-06-09T19:21:20Z")

</div>

Trying to update Mastodon v4.3.6 to v4.5.11?

---

<div class="post-metadata">

### Author: ![mossy](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mossy/32/13675_2.png) [@mossy](https://forum.yunohost.org/u/mossy)
#### Post date: [June 9, 2026, 7:23pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/3 "2026-06-09T19:23:33Z")

</div>

Yes!

---

<div class="post-metadata">

### Author: ![mossy](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mossy/32/13675_2.png) [@mossy](https://forum.yunohost.org/u/mossy)
#### Post date: [June 9, 2026, 7:24pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/4 "2026-06-09T19:24:02Z")

</div>

But I can’t update anything until I can restore from backup

---

<div class="post-metadata">

### Author: ![JfmbLinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/jfmblinux/32/11238_2.png) [@JfmbLinux](https://forum.yunohost.org/u/JfmbLinux)
#### Post date: [June 9, 2026, 7:25pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/5 "2026-06-09T19:25:42Z")

</div>

How did you make the updates on your server?  
Web administrator  
SSH

> [@mossy](#):
>
> To install the version of bundler this project requires, run gem install bundler -v ‘~\> 2.6’

It is requested to execute: ` run gem install bundler -v '~> 2.6'`

---

<div class="post-metadata">

### Author: ![mossy](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mossy/32/13675_2.png) [@mossy](https://forum.yunohost.org/u/mossy)
#### Post date: [June 9, 2026, 7:27pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/6 "2026-06-09T19:27:00Z")

</div>

> [@JfmbLinux](#):
>
> How did you make the updates on your server?

I just used the web admin

---

<div class="post-metadata">

### Author: ![JfmbLinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/jfmblinux/32/11238_2.png) [@JfmbLinux](https://forum.yunohost.org/u/JfmbLinux)
#### Post date: [June 9, 2026, 7:45pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/7 "2026-06-09T19:45:15Z")

</div>

Try this:

```auto
sudo yunohost app remove mastodon

```

```auto
sudo yunohost backup restore mastodon-pre-upgrade1

```

---

<div class="post-metadata">

### Author: ![mossy](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mossy/32/13675_2.png) [@mossy](https://forum.yunohost.org/u/mossy)
#### Post date: [June 9, 2026, 8:12pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/8 "2026-06-09T20:12:12Z")

</div>

Even less success on that front I’m afraid

```auto
Info: Preparing archive for restoration…
Info: Restoring mastodon…
Error: Failed to read info for mastodon : Invalid version: ‘0:’
Error: Failed to read info for mumbleserver : Invalid version: ‘0:’
Error: Could not restore mastodon: Something unexpected went wrong:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/yunohost/backup.py”, line 1380, in _restore_app
_tools_migrations_run_before_app_restore(
File “/usr/lib/python3/dist-packages/yunohost/tools.py”, line 1079, in _tools_migrations_run_before_app_restore
current_version = version.parse(ynh_packages_version()[“yunohost”][“version”])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/packaging/version.py”, line 52, in parse
return Version(version)
^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/packaging/version.py”, line 197, in init
raise InvalidVersion(f"Invalid version: ‘{version}’")
packaging.version.InvalidVersion: Invalid version: ‘0:’

Info: The operation ‘Restore ‘mastodon’ from a backup archive’ could not be completed. Please share the full log of this operation using the command ‘yunohost log share 20260609-200950-backup_restore_app-mastodon’ to get help
sh: 0: getcwd() failed: No such file or directory
sh: 0: getcwd() failed: No such file or directory
Error: Nothing was restored

root@mossy:/var/www/mastodon/live# yunohost log share 20260609-200950-backup_restore_app-mastodon
Error: Something wrong happened while trying to paste data on paste.yunohost.org: HTTPSConnectionPool(host=‘paste.yunohost.org’, port=443): Read timed out. (read timeout=30)

```

---

<div class="post-metadata">

### Author: ![JfmbLinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/jfmblinux/32/11238_2.png) [@JfmbLinux](https://forum.yunohost.org/u/JfmbLinux)
#### Post date: [June 9, 2026, 8:32pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/9 "2026-06-09T20:32:16Z")

</div>

It would have been better to update as they came rather than make version 4.3.6 to version 4.5.11.  
You missed a lot of them

Here are the versions you missed:  
v4.5.11  
v4.5.10  
v4.5.8  
v4.5.7  
v4.5.6  
v4.5.5

List:

> **[YunoRunner for CI](https://ci-apps.yunohost.org/ci/apps/mastodon/)**

---

<div class="post-metadata">

### Author: ![mossy](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mossy/32/13675_2.png) [@mossy](https://forum.yunohost.org/u/mossy)
#### Post date: [June 9, 2026, 8:33pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/10 "2026-06-09T20:33:04Z")

</div>

How is it possible to do that through web admin?

---

<div class="post-metadata">

### Author: ![JfmbLinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/jfmblinux/32/11238_2.png) [@JfmbLinux](https://forum.yunohost.org/u/JfmbLinux)
#### Post date: [June 9, 2026, 8:52pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/11 "2026-06-09T20:52:44Z")

</div>

To be honest, the best thing would be to do a new installation on its own.

Via SSH  
Create folder to put backups

Ex:

```auto
mkdir /var/www/backups/mastodon_backup

```

BACKUP 💾 :

```auto
cd /var/www/mastodon/live
pg_dump -U mastodon -W -F t mastodon > /var/www/backups/mastodon_backup/mastodon_backup.dump

```

RESTORE 🛠:

```auto
cd /var/www/mastodon/live
pg_restore -U mastodon -d mastodon < /var/www/backups/mastodon_backup/mastodon_backup.dump

```

Here’s another example of backup.

> [@Failed restore of Mastodon](https://forum.yunohost.org/t/failed-restore-of-mastodon/41813/23):
>
> Back up the Mastodon database and configuration files. Create a backup of the Mastodon database and configuration files BACKUP floppy_disk : mkdir /var/www/backups/mastodon\_backup cd /var/www/mastodon/live pg\_dump -U mastodon -W -F t mastodon \> /var/www/backups/mastodon\_backup/mastodon\_backup.dump The password is found in the .env.production file, on the line: nano /var/www/mastodon/live/.env.production PostgreSQL DB\_PASS=”xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx” Back up the following folders: c…

Then make a new installation

---

<div class="post-metadata">

### Author: ![mossy](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mossy/32/13675_2.png) [@mossy](https://forum.yunohost.org/u/mossy)
#### Post date: [June 9, 2026, 8:59pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/12 "2026-06-09T20:59:38Z")

</div>

Thanks so much. I will try tomorrow. Would there be any issue importing my old database into the latest version of Mastodon?

---

<div class="post-metadata">

### Author: ![JfmbLinux](https://forum.yunohost.org/user_avatar/forum.yunohost.org/jfmblinux/32/11238_2.png) [@JfmbLinux](https://forum.yunohost.org/u/JfmbLinux)
#### Post date: [June 9, 2026, 9:03pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/13 "2026-06-09T21:03:10Z")

</div>

I don’t know, I’ve always done normally Mastodon updates…  
You have to try.  
Good Luck 🤞

---

<div class="post-metadata">

### Author: ![mossy](https://forum.yunohost.org/user_avatar/forum.yunohost.org/mossy/32/13675_2.png) [@mossy](https://forum.yunohost.org/u/mossy)
#### Post date: [June 17, 2026, 1:13pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/14 "2026-06-17T13:13:14Z")

</div>

I ended up installing the latest version and unzipping the YunoHost backup to restore manually. Here’s what I did, for anyone’s future reference. Should let you update to any new mastodon version from the backup of any old one (if you also follow any version-specific upgrade instructions)

> systemctl stop ‘mastodon-\*.service’
> 
> cd /var/www/mastodon/live  
> mkdir backup  
> cd backup  
> tar -xvf /home/yunohost.backup/archives/mastodon-pre-upgrade1.tar  
> cd ..  
> chown -R mastodon backup/
> 
> sudo -u postgres psql  
> DROP DATABASE mastodon;  
> ALTER USER mastodon CREATEDB;  
> \q
> 
> cd /var/www/mastodon/live && sudo -u mastodon RAILS\_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/rails db:create
> 
> cd backup/apps/mastodon/backup/
> 
> (password for psql mastodon user is in live/.env.production)
> 
> sudo -u mastodon psql mastodon \< “./db.sql”
> 
> su - mastodon
> 
> (copy keys from live/backup/apps/mastodon/backup/var/www/mastodon/live/.env.production to live/.env.production)
> 
> rm -rf live/public/system/  
> mv live/backup/apps/mastodon/backup/var/www/mastodon/live/public/system live/public/
> 
> cd /var/www/mastodon/live && sudo -u mastodon RAILS\_ENV=production
> 
> LD\_PRELOAD=libjemalloc.so PATH=/opt/rbenv/versions/mastodon/bin bin/bundle exec rails db:migrate
> 
> cd /var/www/mastodon/live && sudo -u mastodon RAILS\_ENV=production PATH=/opt/rbenv/versions/mastodon/bin bin/rails runner rename.rb

---

<div class="post-metadata">

### Author: ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)
#### Post date: [July 2, 2026, 1:13pm UTC](https://forum.yunohost.org/t/mastodon-restore-from-backup-fails-could-not-find-bundler/42421/15 "2026-07-02T13:13:59Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
