(Mastodon Upgrade): Difference between revisions
Created page with "sudo cp /var/lib/redis/dump.rdb /tmp/backup.rdb sudo su - mastodon pg_dump mastodon_production > /tmp/backup.psqld cp live/.env.production /tmp/.env.production sudo su - mastodon cd live RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.0.4 rbenv global 3.0.4 git fetch && git checkout v4.0.2 bundle install yarn install SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate RAILS_ENV=production bundle exec rails assets:precompile e..." |
solve mismatch collation pysql |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 4: | Line 4: | ||
pg_dump mastodon_production > /tmp/backup.psqld | pg_dump mastodon_production > /tmp/backup.psqld | ||
cp live/.env.production /tmp/.env.production | cp live/.env.production /tmp/.env.production | ||
| Line 9: | Line 10: | ||
cd live | cd live | ||
RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.0.4 | RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.0.4 | ||
rbenv global 3.0.4 | rbenv global 3.0.4 | ||
git fetch && git checkout v4.0.2 | git fetch && git checkout v4.0.2 | ||
git -C /home/mastodon/.rbenv/plugins/ruby-build pull | |||
bundle install | bundle install | ||
yarn install | yarn install | ||
SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate | SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate | ||
RAILS_ENV=production bundle exec rails assets:precompile | |||
RAILS_ENV=production bundle exec rails assets:precompile " Ako ima greshka da se probva sus: | |||
NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=production bundle exec rails assets:precompile " https://github.com/mastodon/mastodon/issues/24141 | |||
exit | exit | ||
sudo systemctl restart 'mastodon*' | sudo systemctl restart 'mastodon*' | ||
sudo su - mastodon | sudo su - mastodon | ||
cd live && RAILS_ENV=production bundle exec rails db:migrate | cd live && RAILS_ENV=production bundle exec rails db:migrate | ||
exit | exit | ||
sudo systemctl restart 'mastodon*' | sudo systemctl restart 'mastodon*' | ||
https://techbits.io/mastodon-4-upgrade/ | https://techbits.io/mastodon-4-upgrade/ | ||
---------------------------------------------------------------------------------------------------------------------------------- | |||
WARNING: database "mastodon_production" has a collation version mismatch | |||
DETAIL: The database was created using collation version 2.40, but the operating system provides version 2.41. | |||
HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE mastodon_production REFRESH COLLATION VERSION, or build PostgreSQL with the right library version. | |||
1. make backup of postresql of mastodon: | |||
pg_dump mastodon_production > mastodon_backup.sql | |||
In case you dont need make backup skip point 1. | |||
2. Connect with user postgres and psql: | |||
sudo -u postgres psql | |||
3. This generate all index with database using collation actual | |||
REINDEX DATABASE "mastodon_production"; | |||
4. Refresh version of collation: | |||
ALTER DATABASE mastodon_production REFRESH COLLATION VERSION; | |||
5. Verify that it dont appear mismatch collation: | |||
psql \q | |||
and return connect | |||
6. connect to database: | |||
\c mastodon_production | |||
Latest revision as of 00:15, 22 May 2025
sudo cp /var/lib/redis/dump.rdb /tmp/backup.rdb
sudo su - mastodon
pg_dump mastodon_production > /tmp/backup.psqld
cp live/.env.production /tmp/.env.production
sudo su - mastodon
cd live
RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 3.0.4
rbenv global 3.0.4
git fetch && git checkout v4.0.2
git -C /home/mastodon/.rbenv/plugins/ruby-build pull
bundle install
yarn install
SKIP_POST_DEPLOYMENT_MIGRATIONS=true RAILS_ENV=production bundle exec rails db:migrate
RAILS_ENV=production bundle exec rails assets:precompile " Ako ima greshka da se probva sus:
NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=production bundle exec rails assets:precompile " https://github.com/mastodon/mastodon/issues/24141
exit
sudo systemctl restart 'mastodon*'
sudo su - mastodon
cd live && RAILS_ENV=production bundle exec rails db:migrate
exit
sudo systemctl restart 'mastodon*'
https://techbits.io/mastodon-4-upgrade/
WARNING: database "mastodon_production" has a collation version mismatch DETAIL: The database was created using collation version 2.40, but the operating system provides version 2.41. HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE mastodon_production REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
1. make backup of postresql of mastodon:
pg_dump mastodon_production > mastodon_backup.sql
In case you dont need make backup skip point 1.
2. Connect with user postgres and psql:
sudo -u postgres psql
3. This generate all index with database using collation actual
REINDEX DATABASE "mastodon_production";
4. Refresh version of collation:
ALTER DATABASE mastodon_production REFRESH COLLATION VERSION;
5. Verify that it dont appear mismatch collation:
psql \q
and return connect
6. connect to database:
\c mastodon_production