-
Notifications
You must be signed in to change notification settings - Fork 318
Upgrading To Scumblr 2.0 From Scumblr 1.X
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
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:
-
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.
-
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
- 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.
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.
- Run the following command:
rake db:data:dump
- This should create a data.yml file inside the db folder. Confirm this file has been created.
Note: This step can be skipped if you have an existing Postgres database server you intend to use
- 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
- Create a database user (replace "scumblr" with the username you want)
sudo -u postgres createuser scumblr -s
- Set a password for the user (replace "scumblr" with the username you used)
sudo -u postgres psql
\password scumblr
- Provide a password at the prompts
- Type: "\q" to exit
Note: You can skip this step if you are using an existing database.
- 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
Note: You can skip this step if you are using an existing database.
- 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
- 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
- Get the 2.0 Scumblr code:
git fetch --tags
git checkout tags/v2.0.1a
- Run the following commands to install required gems
gem install bundler --no-ri --no-rdoc
gem install sidekiq --no-ri --no-rdoc
rbenv rehash
- Update the Gem bundle
bundle install
- Update the database
rake db:migrate
Run the following from the command line:
sudo apt-get install python-dev python-pip
sudo pip install bandit
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
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