Updating: Difference between revisions
Apostrophyx (talk | contribs) |
(I caught a stray word) |
||
(71 intermediate revisions by 15 users not shown) | |||
Line 1: | Line 1: | ||
This page contains specific directions on how to update diaspora*, if any special steps are necessary. If there are no special steps necessary, you can stick to the general guide in the section [[#Updating a production install to a new minor version|Updating a production install to a new minor version]]. | |||
These guides are generally for production setups, if you're developing for diaspora* you should know which steps are relevant to update your development setup. The general steps are available in the section [[#Updating a development install|Updating a development install]]. If you run into any troubles, seek help via the usual channels. | |||
{{Note|Updating Diaspora is fairly straight forward. But sometimes there are special procedures or updates, so always read the [https://github.com/diaspora/diaspora/blob/main/Changelog.md changelog] first.}} | |||
= Updating a production install to a new minor version = | |||
First, make sure you stop your diaspora* pod before proceeding to update your installation. In case you followed the recommended setup and are on RVM, update RVM and install the currently recommended Ruby version: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
rvm | rvm get master | ||
rvm | rvm install 3.3 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Note|If you receive an error about RVM failing to verify signatures, please follow [https://rvm.io/rvm/security#install-our-keys the RVM documentation at "Install our keys"] to import the current keys.}} | |||
Afterwards, we need to update the code: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
git checkout Gemfile.lock | git checkout Gemfile.lock # Discard uninteresting local changes, if any | ||
git pull | git pull | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 37: | Line 35: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
bundle | script/configure_bundler | ||
bin/bundle --full-index | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Ignore any migration notes this command gives you, they're already done for you or explicitly advised in our changelog! | {{Note|Ignore any migration notes this command gives you, they're already done for you or explicitly advised in our changelog!}} | ||
Then we apply updates to the database schema, attention this might take some time if you have a big database already: | Then we apply updates to the database schema, attention this might take some time if you have a big database already: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
RAILS_ENV=production | RAILS_ENV=production bin/rake db:migrate | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Update the static content: | Update the static content, which is also likely to take a several minutes and may not give any output at first: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
RAILS_ENV=production | RAILS_ENV=production bin/rake assets:precompile | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Make sure to check new configuration options in <tt>diaspora.toml.example</tt>. Tools like <tt>diff</tt> and <tt>vimdiff</tt> can help transfering new sections. | |||
Now you need to restart Diaspora. To do this with the standard startup method you need to get to the place where you run <tt>./script/server</tt>, hit <tt>Ctrl+C</tt>, open a new shell, and run it again. | Now you need to restart Diaspora. To do this with the standard startup method you need to get to the place where you run <tt>./script/server</tt>, hit <tt>Ctrl+C</tt>, open a new shell, and run it again. | ||
= Major version update guides = | |||
While it's fine to skip updates for minor versions, do not try to upgrade from one major version to another major version while skipping one or more in between. For example, do not update from 0.5 to 0.7; instead, update from 0.5 to 0.6 and then from 0.6 to 0.7. | |||
== Updating diaspora* 0.7 to diaspora* 0.9 == | |||
There was no 0.8, so you did not miss anything! However, if your pod is not running on version 0.7.18.2, please update to that first! | |||
# '''Do not rush this'''. Major updates can take a while. Take your time, and make sure you have a full backup before you start! If you run into unexpected issues, take a deep breath, we're here to help: [https://discourse.diasporafoundation.org/ Start a new thread in our Discourse Support section] and we'll get back to you as soon as we can. | |||
# Before you do anything, [https://github.com/diaspora/diaspora/blob/v0.9.0.0/Changelog.md read the full Changelog] so you have a good understanding of the changes in this release. | |||
# diaspora* 0.9 requires a couple of new system packages. For Ubuntu and Debian, you can run <tt>apt-get install libidn11-dev yarnpkg</tt> to install those. For Fedora, you need to add a third-party repository first. Please refer [[Installation|to the installation guides for your Fedora version]] and follow the "Install packages" steps. | |||
# Stop your diaspora pod now. Do not try to start the update while your pod is running, or you will make a lot of kittens really sad. | |||
# Update your RVM with <tt>rvm get master</tt> and install the required Ruby version with <tt>rvm install 3.3</tt>. | |||
# Enter your <tt>diaspora</tt> directory. If you're currently on the <tt>master</tt> branch, please run <tt>git switch main</tt> to switch to the new branch. Run <tt>git pull</tt> to ensure that all the new changes are fetched. | |||
# Allow RVM to set up Ruby correctly by running <tt>cd .. && cd -</tt> | |||
# We switched out configuration file format! Your old <tt>diaspora.yml</tt> is deprecated. Because you need to make changes to the config file anyway, we recommend switchting to the new format now. To do that, copy the new template with <tt>cp config/diaspora.toml.exmaple config/diaspora.toml</tt>. Then, take note of all the changed values in your current <tt>config/diaspora.yml</tt> and transfer them to the new file. Make sure to only transfer the values, not entire portions of the file - as some settings might be renamed. Also, make sure to to read the Changelog to spot the breaking changes. When you're done, remove the old <tt>diaspora.yml</tt>. | |||
# Run <tt>bin/bundle install --full-index</tt> to install all the Ruby dependencies. | |||
# Update the database with <tt>RAILS_ENV=production bin/rake db:migrate</tt>. This can take a while - we recommend running this inside a <tt>tmux</tt> so that the process doesn't stop if your SSH session disconnects. | |||
# Update the frontend assets with <tt>RAILS_ENV=production bin/rake tmp:cache:clear assets:precompile</tt>. | |||
# Start your pod again. Take special notice to the changes to <tt>script/server</tt> that have been outlined in the changelog! | |||
And that should be it! Enjoy your freshly updated pod! | |||
== Updating diaspora* 0.6 to diaspora* 0.7 == | |||
Since there are a couple of major changes in upgrading to 0.7 which involve manual action, we provide a step by step guide. Please ensure to update to diaspora* 0.6 prior these steps. | |||
{{Note|If, and only if, you were testing the release candidate, skip this guide, run <tt>git checkout master && git pull</tt> and proceed with the minor release update instructions above.}} | |||
<ol> | |||
<li>Backup your database, run the following steps in a screen or tmux session so they can't be interrupted when for example your SSH connection drops. Run all commands from within your diaspora* installation path.</li> | |||
<li>Update RVM with <tt>rvm get latest</tt> and install Ruby 2.4 with <tt>rvm install 2.4</tt>. Ruby 2.1 and Ruby 2.2 are no longer supported. Ruby 2.3 however is supported.</li> | |||
<li>Stop diaspora* now, it can't be running during the update or else the migrations will fail.</li> | |||
<li>Update diaspora* by running <tt>git checkout db/schema.rb</tt> and <tt>git pull; git checkout master</tt>.</li> | |||
<li>Run <tt>git status</tt> and delete all "Untracked files", especially make sure to delete <tt>public/.well-known/host-meta</tt>, since it will prevent the federation from working properly.</li> | |||
<li>Activate the new Ruby with <tt>cd .. && cd -</tt>.</li> | |||
<li>Install the latest Bundler version with <tt>gem install bundler</tt>.</li> | |||
<li>Sometimes the bundler config is broken, so run <tt>script/configure_bundler</tt> to ensure it's correct.</li> | |||
<li>Install the dependencies with <tt>bin/bundle</tt>. CAREFUL: Do not run any commands that are suggested at the end of the terminal output; that was already done for you.</li> | |||
<li>Update the database with <tt>RAILS_ENV=production bin/rake db:migrate</tt>.</li> | |||
<li>When the database was successfully updated, update the assets with: <tt>RAILS_ENV=production bin/rake tmp:cache:clear assets:precompile</tt>.</li> | |||
<li>Next you can start diaspora* again. Don't forget to adjust the Ruby version in any startup scripts you may have.</li> | |||
</ol> | |||
You should now compare your <tt>config/diaspora.yml</tt> to the updated <tt>config/diaspora.yml.example</tt>, for example with <tt>vimdiff</tt>. | |||
Have a look at the [https://github.com/diaspora/diaspora/blob/ecd4601bacd8b2e235a05ce6d713fe8cebe89562/Changelog.md changelog] for the full list of changes. | |||
== Updating diaspora* 0.5 to diaspora* 0.6 == | |||
Since there are a couple of major changes in upgrading to 0.6 which involve manual action, we provide a step by step guide. Please ensure to update to diaspora* 0.5 prior these steps. | |||
{{Note|This update will take a bit longer since it includes a couple of potentially long running migrations, especially for bigger databases.}} | |||
<ol> | |||
<li>First, make sure you stop your diaspora* pod before proceeding to update your installation.</li> | |||
<li>Backup your database, run the following steps in a screen or tmux session so they can't be interrupted when for example your SSH connection drops. Run all commands from within your diaspora* installation path.</li> | |||
<li>Update RVM with <tt>rvm get latest</tt> and install Ruby 2.3 with <tt>rvm install 2.3</tt>. Ruby 2.0 is no longer supported and Ruby 2.2 is not officially supported but may work. Ruby 2.1 however is supported.</li> | |||
<li>Stop diaspora* now, it can't be running during the update or else the migrations will fail.</li> | |||
<li>With the old Ruby 2.1 still activated, run <tt>RAILS_ENV=production bundle exec sidekiq</tt> (add <tt>DB=postgres</tt> to the command if you're a PostgreSQL user), wait 5 minutes and take it down again with <tt>Ctrl+C</tt>.</li> | |||
<li>Ensure to activate the new Ruby with <tt>rvm use 2.3</tt>.</li> | |||
<li>Install the latest Bundler version with <tt>gem install bundler --version 1.15.4</tt>.</li> | |||
<li>Update diaspora* by running <tt>git checkout Gemfile.lock db/schema.rb</tt> and <tt>git pull; git checkout v0.6.7.0</tt>.</li> | |||
<li>The <tt>DB</tt> environment variable is gone, instead now we need to tell Bundler which database support to install. Run <tt>bin/bundle install --full-index --with mysql --deployment</tt> for MySQL support, run <tt>bin/bundle install --full-index --with postgresql --deployment</tt> for PostgreSQL support. Bundler remembers this choice and you won't have to specify it again. Ignore any migration notes this command gives you, they're already done for you.</li> | |||
<li>Update the database with <tt>RAILS_ENV=production bin/rake db:migrate</tt>. This will take some time, be patient.</li> | |||
<li>After or while the database is updating, review some of the new configuration defaults. The most important change is that the application server no longer listens to port 3000 by default, instead it now listens to a UNIX socket at <tt>tmp/diaspora.sock</tt>. You should either update your reverse proxy configuration to use the socket, or update <tt>config/diaspora.yml</tt> and explicitly configure it to listen to port 3000. You can find a summary of other important changes below.</li> | |||
<li>When the database was successfully updated, update the assets with: <tt>RAILS_ENV=production bin/rake tmp:cache:clear assets:precompile</tt>.</li> | |||
<li>Next you can start diaspora* again. Don't forget to adjust the Ruby version in any startup scripts you may have.</li> | |||
<li>Finally you need to migrate any jobs from legacy Sidekiq queues to the new ones, to do this run <tt>RAILS_ENV=production bin/rake migrations:legacy_queues</tt>.</li> | |||
</ol> | |||
You should now compare your <tt>config/diaspora.yml</tt> to the updated <tt>config/diaspora.yml.example</tt>, for example with <tt>vimdiff</tt>. Notable changes, not only limited to the configuration, are: | |||
* We dropped support for Redis namespaces in this release. If you previously set a custom namespace, please note that diaspora* will no longer use the configured value. By default, Redis supports up to 8 databases which can be selected via the Redis URL in <tt>config/diaspora.yml</tt>. Please check the examples provided in our configuration example file. | |||
* diaspora* 0.5 introduced an experimental chat feature by making use of Vines. Due to many issues with Vines, we decided to remove it and offer a Prosody example configuration instead. Check [[Integration/Chat]] for more information on how to migrate to Prosody if you've been using Vines before. Unfortunately the feature still is experimental and we recommend careful consideration before you enable it. | |||
* With the port to Bootstrap 3, <tt>app/views/terms/default.haml</tt> has a new structure. If you have created a customised <tt>app/views/terms/terms.haml</tt> or <tt>app/views/terms/terms.erb</tt> file, you will need to edit those files to base your customisations on the new <tt>default.haml</tt> file. | |||
Have a look at the [https://github.com/diaspora/diaspora/blob/master/Changelog.md changelog] for the full list of changes. | |||
== Updating diaspora* 0.4 to diaspora* 0.5 == | |||
Since there are a couple of major changes in upgrading to 0.5 which involve | |||
manual action, we provide a step by step guide. Please ensure to update | |||
to diaspora* 0.4 prior these steps. | |||
{{Note|This update will take from half an hour up to several hours, as it contains a long running migration, especially on MySQL/MariaDB.}} | |||
<ol> | |||
<li>Make sure you stop your diaspora* pod before proceeding to update your installation. </li> | |||
<li>Make a backup of at least the database.</li> | |||
<li>If you're on PostgreSQL run <tt>export DB=postgres RAILS_ENV=production</tt>, if you're on MySQL/MariaDB run <tt>export DB=mysql RAILS_ENV=production</tt>. | |||
If you encounter a <code>rake aborted! NameError: uninitialized constant Rack::SSL</code> in the rest of this guide, that means you didn't execute this step correctly.</li> | |||
<li>Run <tt>bundle exec sidekiq</tt>, wait 5 minutes and take it down again with <tt>Ctrl+C</tt>.</li> | |||
<li>If you modified <tt>public/default.html</tt>, <tt>public/404.html</tt>, <tt>public/422.html</tt> or <tt>public/500.html</tt> take a backup of the changes, they will be gone or overwritten. Run <tt>git checkout Gemfile.lock db/schema.rb public/*.html</tt>. Run <tt>git stash</tt> to preserve any other uncommitted changes. You can later restore stashed changes with <tt>git stash pop</tt>.</li> | |||
<li>Update RVM with <tt>rvm get stable</tt>. Install Ruby 2.1 with <tt>rvm install 2.1</tt>.</li> | |||
<li>Update diaspora with <tt>git pull; git checkout v0.5.10.2</tt>.</li> | |||
<li>Activate the new Ruby with <tt>cd .. && cd -</tt>.</li> | |||
<li>Install the latest Bundler with <tt>gem install bundler --version 1.12.6</tt>.</li> | |||
<li>Install the dependencies with <tt>bin/bundle install --full-index --without development test</tt>. CAREFUL: Do not run any commands that are suggested at the end of the terminal output; that was already done for you.</li> | |||
<li>Verify you didn't run any additional commands already done for you, then run <tt>git status</tt> and delete any untracked files residing in <tt>db/migrate</tt>.</li> | |||
<li>Edit <tt>config/initializers/secret_token.rb</tt>, replace <tt>secret_token</tt> with <tt>secret_key_base</tt>: | |||
<syntaxhighlight lang="ruby"> | |||
# Old | |||
Rails.application.config.secret_token = '***********...' | |||
# New | |||
Diaspora::Application.config.secret_key_base = '*************...' | |||
</syntaxhighlight> | |||
</li> | |||
<li>If you're using MySQL/MariaDB, edit <tt>config/database.yml</tt>: Replace <tt><span style="color: red;">charset: utf8</span></tt> with <tt><span style="color: red;">encoding: utf8mb4</span></tt>, notice how the key changed! Replace <tt><span style="color: red;">collation: utf8_bin</span></tt> with <tt><span style="color: red;">collation: utf8mb4_bin</span></tt>. Have a look at the updated <tt>config/database.yml.example</tt> if you need additional guidance in this step.</li> | |||
<li>Run <tt>bin/rake db:migrate</tt>, this will take quite a while but you should occasionally check if it failed and seek assistance if it happened to fail.</li> | |||
<li>Run <tt>bin/rake tmp:cache:clear assets:precompile</tt>. This steps now generates <tt>public/404.html</tt>, <tt>public/422.html</tt> and <tt>public/500.html</tt>.</li> | |||
<li>You can now start diaspora* again as you're used to.</li> | |||
</ol> | |||
You should now compare your <tt>config/diaspora.yml</tt> to the updated <tt>config/diaspora.yml.example</tt>, for example with <tt>vimdiff</tt>. Notable changes, not only limited to the configuration, are: | |||
* The surrounding markup for the custom splash page changed slightly, please refer to the [https://github.com/diaspora/diaspora/blob/master/Changelog.md#custom-splash-page-changes changelog]. | |||
* If you're using Paypal donations, the settings in <tt>diaspora.yml</tt> for it changed, in order to support the unhosted button. Please take a look at the updated <tt>diaspora.yml.example</tt>. | |||
* The default for including jQuery from a CDN has changed. If you want to continue to include it from a CDN, please explicitly set the <tt>jquery_cdn</tt> setting to true in <tt>diaspora.yml</tt>. | |||
* There's a new feature to automatically prune inactive accounts, if you want to enable it please refer to the [https://github.com/diaspora/diaspora/blob/master/Changelog.md#new-maintenance-feature-to-automatically-expire-inactive-accounts changelog]. | |||
* There's a new feature to proxy embedded images from external sources through your server, strengthening your users privacy. If you want to enable it please refer to [[Camo]]. | |||
* diaspora* 0.5 includes a preview of the new chat feature, if you want to play with it, have a look at [[Vines]]. We do not generally recommend enabling this yet. | |||
= Post update cleanup = | |||
After you verified everything is working again you can free some space. | |||
== Clean old assets == | |||
You can delete now unused precompiled assets by running: | |||
<syntaxhighlight lang="bash"> | |||
RAILS_ENV=production bin/rake assets:clean | |||
</syntaxhighlight> | |||
== Clean old gems == | |||
You can delete now unused gems by running: | |||
<syntaxhighlight lang="bash"> | |||
bin/bundle clean | |||
</syntaxhighlight> | |||
Make sure to only run this if you're not sharing gems with another application. | |||
== Clean old Ruby installations == | |||
If you're using RVM or another Ruby version manager, and switched to another Ruby version during the update, you can drop the old Ruby version. For example for RVM with: | |||
<syntaxhighlight lang="bash"> | |||
rvm uninstall 2.1 | |||
</syntaxhighlight> | |||
Make sure to only run this if you're not sharing the Ruby installation with another application. | |||
= Updating a development install = | = Updating a development install = | ||
Line 65: | Line 223: | ||
git pull # Or git pull upstream develop if you cloned from your fork | git pull # Or git pull upstream develop if you cloned from your fork | ||
cd .. && cd - | cd .. && cd - | ||
bundle | bin/bundle --full-index | ||
rake db:migrate | bin/rake db:migrate | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Podmin]] | [[Category:Podmin]] | ||
[[Category:Installation]] | [[Category:Installation]] |
Latest revision as of 00:10, 16 June 2024
This page contains specific directions on how to update diaspora*, if any special steps are necessary. If there are no special steps necessary, you can stick to the general guide in the section Updating a production install to a new minor version.
These guides are generally for production setups, if you're developing for diaspora* you should know which steps are relevant to update your development setup. The general steps are available in the section Updating a development install. If you run into any troubles, seek help via the usual channels.
Updating a production install to a new minor version
First, make sure you stop your diaspora* pod before proceeding to update your installation. In case you followed the recommended setup and are on RVM, update RVM and install the currently recommended Ruby version:
rvm get master
rvm install 3.3
Afterwards, we need to update the code:
git checkout Gemfile.lock # Discard uninteresting local changes, if any
git pull
Read the output! If you made local modifications to files tracked in git, it might refuse the update or place conflict markers into the files which need to be resolved. If you run on PostgreSQL and get a message about Gemfile.lock try git checkout Gemfile.lock first. If you get one about db/schema.rb try git checkout db/schema.rb.
In case the recommended Ruby version changed you need to install it. Check with
cd .. && cd -
If that outputs a red warning run the command it gives you and do cd .. && cd - again.
Now we need to update the Ruby libraries:
script/configure_bundler
bin/bundle --full-index
Then we apply updates to the database schema, attention this might take some time if you have a big database already:
RAILS_ENV=production bin/rake db:migrate
Update the static content, which is also likely to take a several minutes and may not give any output at first:
RAILS_ENV=production bin/rake assets:precompile
Make sure to check new configuration options in diaspora.toml.example. Tools like diff and vimdiff can help transfering new sections.
Now you need to restart Diaspora. To do this with the standard startup method you need to get to the place where you run ./script/server, hit Ctrl+C, open a new shell, and run it again.
Major version update guides
While it's fine to skip updates for minor versions, do not try to upgrade from one major version to another major version while skipping one or more in between. For example, do not update from 0.5 to 0.7; instead, update from 0.5 to 0.6 and then from 0.6 to 0.7.
Updating diaspora* 0.7 to diaspora* 0.9
There was no 0.8, so you did not miss anything! However, if your pod is not running on version 0.7.18.2, please update to that first!
- Do not rush this. Major updates can take a while. Take your time, and make sure you have a full backup before you start! If you run into unexpected issues, take a deep breath, we're here to help: Start a new thread in our Discourse Support section and we'll get back to you as soon as we can.
- Before you do anything, read the full Changelog so you have a good understanding of the changes in this release.
- diaspora* 0.9 requires a couple of new system packages. For Ubuntu and Debian, you can run apt-get install libidn11-dev yarnpkg to install those. For Fedora, you need to add a third-party repository first. Please refer to the installation guides for your Fedora version and follow the "Install packages" steps.
- Stop your diaspora pod now. Do not try to start the update while your pod is running, or you will make a lot of kittens really sad.
- Update your RVM with rvm get master and install the required Ruby version with rvm install 3.3.
- Enter your diaspora directory. If you're currently on the master branch, please run git switch main to switch to the new branch. Run git pull to ensure that all the new changes are fetched.
- Allow RVM to set up Ruby correctly by running cd .. && cd -
- We switched out configuration file format! Your old diaspora.yml is deprecated. Because you need to make changes to the config file anyway, we recommend switchting to the new format now. To do that, copy the new template with cp config/diaspora.toml.exmaple config/diaspora.toml. Then, take note of all the changed values in your current config/diaspora.yml and transfer them to the new file. Make sure to only transfer the values, not entire portions of the file - as some settings might be renamed. Also, make sure to to read the Changelog to spot the breaking changes. When you're done, remove the old diaspora.yml.
- Run bin/bundle install --full-index to install all the Ruby dependencies.
- Update the database with RAILS_ENV=production bin/rake db:migrate. This can take a while - we recommend running this inside a tmux so that the process doesn't stop if your SSH session disconnects.
- Update the frontend assets with RAILS_ENV=production bin/rake tmp:cache:clear assets:precompile.
- Start your pod again. Take special notice to the changes to script/server that have been outlined in the changelog!
And that should be it! Enjoy your freshly updated pod!
Updating diaspora* 0.6 to diaspora* 0.7
Since there are a couple of major changes in upgrading to 0.7 which involve manual action, we provide a step by step guide. Please ensure to update to diaspora* 0.6 prior these steps.
- Backup your database, run the following steps in a screen or tmux session so they can't be interrupted when for example your SSH connection drops. Run all commands from within your diaspora* installation path.
- Update RVM with rvm get latest and install Ruby 2.4 with rvm install 2.4. Ruby 2.1 and Ruby 2.2 are no longer supported. Ruby 2.3 however is supported.
- Stop diaspora* now, it can't be running during the update or else the migrations will fail.
- Update diaspora* by running git checkout db/schema.rb and git pull; git checkout master.
- Run git status and delete all "Untracked files", especially make sure to delete public/.well-known/host-meta, since it will prevent the federation from working properly.
- Activate the new Ruby with cd .. && cd -.
- Install the latest Bundler version with gem install bundler.
- Sometimes the bundler config is broken, so run script/configure_bundler to ensure it's correct.
- Install the dependencies with bin/bundle. CAREFUL: Do not run any commands that are suggested at the end of the terminal output; that was already done for you.
- Update the database with RAILS_ENV=production bin/rake db:migrate.
- When the database was successfully updated, update the assets with: RAILS_ENV=production bin/rake tmp:cache:clear assets:precompile.
- Next you can start diaspora* again. Don't forget to adjust the Ruby version in any startup scripts you may have.
You should now compare your config/diaspora.yml to the updated config/diaspora.yml.example, for example with vimdiff.
Have a look at the changelog for the full list of changes.
Updating diaspora* 0.5 to diaspora* 0.6
Since there are a couple of major changes in upgrading to 0.6 which involve manual action, we provide a step by step guide. Please ensure to update to diaspora* 0.5 prior these steps.
- First, make sure you stop your diaspora* pod before proceeding to update your installation.
- Backup your database, run the following steps in a screen or tmux session so they can't be interrupted when for example your SSH connection drops. Run all commands from within your diaspora* installation path.
- Update RVM with rvm get latest and install Ruby 2.3 with rvm install 2.3. Ruby 2.0 is no longer supported and Ruby 2.2 is not officially supported but may work. Ruby 2.1 however is supported.
- Stop diaspora* now, it can't be running during the update or else the migrations will fail.
- With the old Ruby 2.1 still activated, run RAILS_ENV=production bundle exec sidekiq (add DB=postgres to the command if you're a PostgreSQL user), wait 5 minutes and take it down again with Ctrl+C.
- Ensure to activate the new Ruby with rvm use 2.3.
- Install the latest Bundler version with gem install bundler --version 1.15.4.
- Update diaspora* by running git checkout Gemfile.lock db/schema.rb and git pull; git checkout v0.6.7.0.
- The DB environment variable is gone, instead now we need to tell Bundler which database support to install. Run bin/bundle install --full-index --with mysql --deployment for MySQL support, run bin/bundle install --full-index --with postgresql --deployment for PostgreSQL support. Bundler remembers this choice and you won't have to specify it again. Ignore any migration notes this command gives you, they're already done for you.
- Update the database with RAILS_ENV=production bin/rake db:migrate. This will take some time, be patient.
- After or while the database is updating, review some of the new configuration defaults. The most important change is that the application server no longer listens to port 3000 by default, instead it now listens to a UNIX socket at tmp/diaspora.sock. You should either update your reverse proxy configuration to use the socket, or update config/diaspora.yml and explicitly configure it to listen to port 3000. You can find a summary of other important changes below.
- When the database was successfully updated, update the assets with: RAILS_ENV=production bin/rake tmp:cache:clear assets:precompile.
- Next you can start diaspora* again. Don't forget to adjust the Ruby version in any startup scripts you may have.
- Finally you need to migrate any jobs from legacy Sidekiq queues to the new ones, to do this run RAILS_ENV=production bin/rake migrations:legacy_queues.
You should now compare your config/diaspora.yml to the updated config/diaspora.yml.example, for example with vimdiff. Notable changes, not only limited to the configuration, are:
- We dropped support for Redis namespaces in this release. If you previously set a custom namespace, please note that diaspora* will no longer use the configured value. By default, Redis supports up to 8 databases which can be selected via the Redis URL in config/diaspora.yml. Please check the examples provided in our configuration example file.
- diaspora* 0.5 introduced an experimental chat feature by making use of Vines. Due to many issues with Vines, we decided to remove it and offer a Prosody example configuration instead. Check Integration/Chat for more information on how to migrate to Prosody if you've been using Vines before. Unfortunately the feature still is experimental and we recommend careful consideration before you enable it.
- With the port to Bootstrap 3, app/views/terms/default.haml has a new structure. If you have created a customised app/views/terms/terms.haml or app/views/terms/terms.erb file, you will need to edit those files to base your customisations on the new default.haml file.
Have a look at the changelog for the full list of changes.
Updating diaspora* 0.4 to diaspora* 0.5
Since there are a couple of major changes in upgrading to 0.5 which involve manual action, we provide a step by step guide. Please ensure to update to diaspora* 0.4 prior these steps.
- Make sure you stop your diaspora* pod before proceeding to update your installation.
- Make a backup of at least the database.
- If you're on PostgreSQL run export DB=postgres RAILS_ENV=production, if you're on MySQL/MariaDB run export DB=mysql RAILS_ENV=production.
If you encounter a
rake aborted! NameError: uninitialized constant Rack::SSL
in the rest of this guide, that means you didn't execute this step correctly. - Run bundle exec sidekiq, wait 5 minutes and take it down again with Ctrl+C.
- If you modified public/default.html, public/404.html, public/422.html or public/500.html take a backup of the changes, they will be gone or overwritten. Run git checkout Gemfile.lock db/schema.rb public/*.html. Run git stash to preserve any other uncommitted changes. You can later restore stashed changes with git stash pop.
- Update RVM with rvm get stable. Install Ruby 2.1 with rvm install 2.1.
- Update diaspora with git pull; git checkout v0.5.10.2.
- Activate the new Ruby with cd .. && cd -.
- Install the latest Bundler with gem install bundler --version 1.12.6.
- Install the dependencies with bin/bundle install --full-index --without development test. CAREFUL: Do not run any commands that are suggested at the end of the terminal output; that was already done for you.
- Verify you didn't run any additional commands already done for you, then run git status and delete any untracked files residing in db/migrate.
- Edit config/initializers/secret_token.rb, replace secret_token with secret_key_base:
# Old Rails.application.config.secret_token = '***********...' # New Diaspora::Application.config.secret_key_base = '*************...'
- If you're using MySQL/MariaDB, edit config/database.yml: Replace charset: utf8 with encoding: utf8mb4, notice how the key changed! Replace collation: utf8_bin with collation: utf8mb4_bin. Have a look at the updated config/database.yml.example if you need additional guidance in this step.
- Run bin/rake db:migrate, this will take quite a while but you should occasionally check if it failed and seek assistance if it happened to fail.
- Run bin/rake tmp:cache:clear assets:precompile. This steps now generates public/404.html, public/422.html and public/500.html.
- You can now start diaspora* again as you're used to.
You should now compare your config/diaspora.yml to the updated config/diaspora.yml.example, for example with vimdiff. Notable changes, not only limited to the configuration, are:
- The surrounding markup for the custom splash page changed slightly, please refer to the changelog.
- If you're using Paypal donations, the settings in diaspora.yml for it changed, in order to support the unhosted button. Please take a look at the updated diaspora.yml.example.
- The default for including jQuery from a CDN has changed. If you want to continue to include it from a CDN, please explicitly set the jquery_cdn setting to true in diaspora.yml.
- There's a new feature to automatically prune inactive accounts, if you want to enable it please refer to the changelog.
- There's a new feature to proxy embedded images from external sources through your server, strengthening your users privacy. If you want to enable it please refer to Camo.
- diaspora* 0.5 includes a preview of the new chat feature, if you want to play with it, have a look at Vines. We do not generally recommend enabling this yet.
Post update cleanup
After you verified everything is working again you can free some space.
Clean old assets
You can delete now unused precompiled assets by running:
RAILS_ENV=production bin/rake assets:clean
Clean old gems
You can delete now unused gems by running:
bin/bundle clean
Make sure to only run this if you're not sharing gems with another application.
Clean old Ruby installations
If you're using RVM or another Ruby version manager, and switched to another Ruby version during the update, you can drop the old Ruby version. For example for RVM with:
rvm uninstall 2.1
Make sure to only run this if you're not sharing the Ruby installation with another application.
Updating a development install
Just checkout the develop branch, pull (from upstream), rebundle and migrate the database:
cd diaspora
git checkout develop
git pull # Or git pull upstream develop if you cloned from your fork
cd .. && cd -
bin/bundle --full-index
bin/rake db:migrate