Updating: Difference between revisions

From diaspora* project wiki
No edit summary
(Prepare for 0.5)
Line 14: Line 14:
rvm install ruby 2.0.0  
rvm install ruby 2.0.0  
rvm use 2.0.0
rvm use 2.0.0
</syntaxhighlight>
If you are upgrading to diaspora version 0.5 or later, you should install ruby 2.1:
<syntaxhighlight lang="bash">
rvm install ruby 2.1
rvm use 2.1
</syntaxhighlight>
</syntaxhighlight>


Line 37: Line 45:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
gem install bundler
bundle # Or DB=postgres bundle for PostgreSQL users
bundle # Or DB=postgres bundle for PostgreSQL users
</syntaxhighlight>
</syntaxhighlight>
Line 45: Line 54:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
RAILS_ENV=production bundle exec rake db:migrate # As always add DB=postgres to the command if you're a PostgreSQL user
RAILS_ENV=production bin/rake db:migrate # As always add DB=postgres to the command if you're a PostgreSQL user
</syntaxhighlight>
</syntaxhighlight>


Line 51: Line 60:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
RAILS_ENV=production bundle exec rake tmp:cache:clear assets:precompile
RAILS_ENV=production bin/rake tmp:cache:clear assets:precompile
</syntaxhighlight>
</syntaxhighlight>


Line 68: Line 77:
cd .. && cd -
cd .. && cd -
bundle # Or DB=postgres bundle if you use PostgreSQL
bundle # Or DB=postgres bundle if you use PostgreSQL
rake db:migrate
bin/rake db:migrate
</syntaxhighlight>
</syntaxhighlight>


[[Category:Podmin]]
[[Category:Podmin]]
[[Category:Installation]]
[[Category:Installation]]

Revision as of 12:44, 25 March 2015

Updating Diaspora is fairly straight forward. But sometimes there are special procedures or updates, so always read the changelog first.

RVM

In case you followed the recommended setup and are on RVM, update RVM first:

rvm get stable

If you are upgrading to diaspora version 0.3 or later, you should install ruby 2.0.0:

rvm install ruby 2.0.0 
rvm use 2.0.0


If you are upgrading to diaspora version 0.5 or later, you should install ruby 2.1:

rvm install ruby 2.1
rvm use 2.1

Updating a production install

We need to update the code first:

git checkout Gemfile.lock db/schema.rb # 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:

gem install bundler
bundle # Or DB=postgres bundle for PostgreSQL users

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:

RAILS_ENV=production bin/rake db:migrate # As always add DB=postgres to the command if you're a PostgreSQL user

Update the static content:

RAILS_ENV=production bin/rake tmp:cache:clear assets:precompile

Make sure to check new configuration options in diaspora.yml.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.

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 -
bundle # Or DB=postgres bundle if you use PostgreSQL
bin/rake db:migrate