Help migrating an instance

Since the production guide on GitHub is outdated, I’m not quite sure how to migrate an instance.

Is it just matter of following the installation guide, copying the system folder, running psql mastodon_production < dump.sql as postgres user and then instead of RAILS_ENV=production bundle exec rake mastodon:setup copying the .env.production file and running RAILS_ENV=production bundle exec rails assets:precompile and RAILS_ENV=production bin/tootctl feeds build ?

you should generally copy over the redis database as well instead of using feeds:build, it’s much quicker and preserves some non-critical usage statistics

1 Like

Do I also have to run RAILS_ENV=production bundle exec rails db:migrate?

db:migrate is used when migrating from one version of the database schema to another version of the database schema. If you use the same database and the same code, then there’s no change that needs to be made to the schema

I migrated and I believe there was an issue restoring my database. My original dump is 321MB, but dumping it after restoring it dumps on 68MB.
The services start, but when I go to my instance, the Mastodon 500 error shows up.

I dropped the database and tried it again and these are the errors. I changed default system locale from en_US to en_US.UTF-8 and the error persists.


It’s fixed. I just needed to do update mastodon_production set encoding = pg_char_to_encoding('UTF8') where datname = 'mastodon_production'

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