I have created my Mastodon instance hosted on Digital Ocean through the One-Click app they offer. Due to so many security issues, I believe it’s time to upgrade for obvious security reasons. At this time the lasted version out is Mastodon version 4.0.2 and I am still on version 3.1.3 Is it possible to upgrade to my current (droplet) version without wiping out my existing instance? Any help, direction, or tutorials would be greatly appreciated. Thank you.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi friend,
I just did this very thing. I don’t know if it’s the best way, but it worked for me.
SSH into your droplet
ssh yourdomain.com
Some of these steps could take a while to complete, you may want to consider persisting your session with screen or tmux, so you can come back to long-running processes if your ssh connection breaks.
screen
Switch to the mastodon user
sudo su - mastodon
Move to the mastodon directory
cd live
Make sure you have the latest tag and check into it
git fetch && git checkout -b v4.0.2
The major version bump introduced an update to the Ruby version, you’ll have to install it. This will take quite a long time, go grab a a meal.
rbenv install $(cat .ruby-version) --verbose
Install the gems for the new version
bundle install
Run the new rails migrations in production mode
RAILS_ENV=production bin/rails db:migrate
Install a fresh set of node packages
rm -rf node_modules && yarn install
Build the JS bundle
yarn build:production
Exit the mastodon user
logout
Restart all the services
sudo systemctl restart mastodon-web.service
sudo systemctl restart mastodon-sidekiq.service
sudo systemctl restart mastodon-streaming.service
And done, you’re on the latest version of Mastodon.
I found this and was able to successfully migrate thanks to this advice…
I had to do a git reset to accomplish this - which was the snag as I kept getting an Ambiguous result when I did the git checkout of v4.0.2.
THis subsequent article helped me overcome that hurdle.
Frustrating! I have followed instructions and even set a swap file and I am still stuck on version 3.1.3. Does anyone have insight as to why this will not upgrade? I am not a coder so I have little experience with that.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.