Skip to content

Upgrading To Scumblr 2.0 From Scumblr 1.X

Scott Behrens edited this page Apr 26, 2017 · 6 revisions

Table of Contents

Overview

Scumblr 2.0 introduces many new features but also has slightly different requirements than the original version of Scumblr. This includes a requirement to use Postgres 9.4+ as a database. If you previously installed Scumblr 1.x and want to upgrade to the new version. Please follow the instructions listed here. All instructions assume you are working on Ubuntu 14.04 and have setup Scumblr as specified in the original documentation.

Note: You should backup your system and database before proceeding

Note: All commands should be run from the root Scumblr directory unless otherwise specified.

For convenience you may want to set an environment variable defining the Rails environment you're working in. For example:

export RAILS_ENV=development

Upgrade to Scumblr 1.1

The first step to upgrade is making sure you're on the latest pre-2.0 version, which is 1.1. To do this perform the following steps:

  1. Make a backup of your database. For sqlite you can simple copy the file (from db/.sqlite). For other databases (such as MySQL, Postgres, etc.) the procedure will vary depending on the database and configuration.

  2. From your existing Scumblr folder run the following commands:

# Update the code to 1.1
git fetch --tags
git checkout tags/v1.1
# Update gems
bundle install

# Migrate the database
rake db:migrate  # May need to specific the environment such as RAILS_ENV=development
  1. At this point you should stop/restart your server and confirm everything is still working normally. If everything looks good proceed to the next section.

Install Postgres and move data

The new version of Scumblr requires Postgres 9.4+. Please follow the instructions based on your current database version:

  • If your current database is Postgres 9.4 or higher skip to the next section.

  • If your current database is Postgres with a version less than 9.4, either upgrade the existing database to 9.4+ or follow these instructions to backup your data and import it into a new Postgres database.

*If your current database is MySQL, SQLite or another other non-Postgres database follow the instructions in this section.

Create a dump of current data

  1. Run the following command:
rake db:data:dump
  1. This should create a data.yml file inside the db folder. Confirm this file has been created.

Install Postgres Locally (Optional)

Note: This step can be skipped if you have an existing Postgres database server you intend to use

  1. Run the following commands to install Postgres
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-common
sudo apt-get install postgresql-9.5 libpq-dev
  1. Create a database user (replace "scumblr" with the username you want)
sudo -u postgres createuser scumblr -s
  1. Set a password for the user (replace "scumblr" with the username you used)
sudo -u postgres psql
\password scumblr
  1. Provide a password at the prompts
  2. Type: "\q" to exit

Update configuration

Note: You can skip this step if you are using an existing database.

  1. Update your database configuration file (config/database.yml) to point to your new database. Example:
development:
        adapter: postgresql
        host: localhost          # Update if you did not install postgres locally
        port: 5432
        username: scumblr        # Update based on the username you set
        password: scumblr        # Update based on the password you set
        database: scumblr_dev    # Update based on the database name you'd like to use
        pool: 5
        timeout: 5000

Load data into new database

Note: You can skip this step if you are using an existing database.

  1. Run the following commands:
# Create the blank database specified in the database.yaml file
rake db:create

# Load saved data into database
rake db:load

Update system

  1. Run the following commands to install Ruby 2.3.1 (assuming rbenv used)
rbenv install 2.3.1
rbenv global 2.3.1
ruby -v
rbenv rehash
  1. Get the 2.0 Scumblr code:
git fetch --tags
git checkout tags/v2.0.1a
  1. Run the following commands to install required gems
gem install bundler --no-ri --no-rdoc
gem install sidekiq --no-ri --no-rdoc
rbenv rehash
  1. Update the Gem bundle
bundle install
  1. Update the database
rake db:migrate

Install Bandit for python static code analysis (optional).

Run the following from the command line:

sudo apt-get install python-dev python-pip
sudo pip install bandit

Restart Scumblr

redis-server &
bundle exec sidekiq -l log/sidekiq.log &
bundle exec rails s -b 0.0.0.0 &

You should now be able to connect to Scumblr:

http://<scumblr_host>:3000

Other Changes

Automatic Syncing

If you had setup cron jobs in Scumblr 1.0 to run searches, you'll need to change the name of the rake tasks being run. The new tasks that are available are:

rake run_tasks_and_email_updates # Run all enabled tasks and then send email updates
rake run_tasks # Run all enabled tasked only
rake send_email_updates # Run email updates only

Further instructions here: https://github.com/Netflix/Scumblr/wiki/Tasks#automatic-syncing

Clone this wiki locally