Image issues since migrating


Hey, everyone. I’ve had some issues since migrating everything to a new server. I asked about it here but haven’t gotten a response yet.

This all started when my Docker install collapsed on itself and took everything out. I still haven’t a clue what happened there, but I had backups and decided to just do a regular install of Mastodon instead. I do this on a virtual machine, and everything migrates fine there. However, when I move everything back to my server I’ve had issues with images. The first problem I had I outlined in the post on the issue tracker where avatars weren’t migrated properly. I’ve since written a tool to do this for me when I notice a missing avatar, but I still don’t know what the issue was that caused it.

Another issue I had was when I purged some unneeded packages from a mate install it took imagemagick out which caused images to mess up in Mastodon obviously. The only indication I received there were any problems were that images weren’t showing up at all. There was nothing in the logs saying that imagemagick was missing. Now images are back, but the posts with images that I received during the time imagemagick was gone still are messed up. How can I fix this?

This issue suggested I use NUM_DAYS=0 RAILS_ENV=production bundle exec rake mastodon:media:remove_remote, but if I run the command I get this as output and no indication it did anything at all:

Scoped order is ignored, it's forced to be batch order.

I’ve searched for it on the issue tracker, but only things that turn up are things that have been fixed. Any nudge in the right direction would be appreciated. Thanks!


I’ve found a tempfix for the images which are missing which pretty much does manually what the remove_remote rake command is supposed to do so leaving it here for people who have the same problem later:

cd ~/live
RAILS_ENV=production bundle exec rails c
m = MediaAttachment.find_by(file_file_name: 'FILENAME.EXT')

I still can’t get remove_remote to work, though.


Also if the image has a url like original/data.png you’ll have to search by remote_url instead, so visit the permalink for the toot, inspect the page, and grab the url of the large original, so it’d be this:

m = MediaAttachment.find_by(remote_url: 'REMOTE_URL')