Skip to content

Migration from using ASI to standalone Kassi

gnomet edited this page May 13, 2012 · 2 revisions

Migration from using ASI to run Kassi without ASI

NOTE: You only need this guide if you have existing installation of Kassi using ASI and want to copy the data from ASI to your Kassi database and start using it in stand alone mode (which is now the default mode).

  1. Shutdown the Kassi server process if running. The ASI server where you are migrating from, needs to be running and responding.
  2. Backup your databases if you want to be sure that nothing is lost
  • e.g. mysqldump -u root -p kassi_production > kassi_backup.sql
  1. You should have the code updated to latest version in master branch
  2. You should have run the migrations to update the Kassi DB rake db:migrate
  3. Edit your config.yml (see newest config.example.yml if your config.yml is missing the new variables)
  • to make the passwords copied from ASI to work, you'll have to set use_asi_encryptor to true
  • to make the migration script run, the use_asi must be set true at this point
  1. In app/models/person.rb there is different functionalities for cases when ASI is used and when not. The migration script needs both, so you need to do a small manual change to that file.
  • copy the following chunk of text and paste it in the person model, (e.g. around line 90 between serialize :preferences and if not ApplicationHelper::use_asi?) and save the file.

has_attached_file :image, :styles => { :medium => "200x350>", :thumb => "50x50#", :original => "600x800>" } validates_attachment_size :image, :less_than => 5.megabytes validates_attachment_content_type :image, :content_type => ["image/jpeg", "image/png", "image/gif", "image/pjpeg", "image/x-png"]

  1. if you don't have curl command installed, install it. (In OS X it's by default)
  2. Run the actual migration script in the Kassi folder rake RAILS_ENV=production kassi:fetch_people_data_from_asi
  • If you want to migrate your development database, then leave out the RAILS_ENV=production
  1. open console in ASI (in production or development environment depending on which ASI env you are migrating from)
  • Copy & Paste the upper part of the script to ASI console. It will create userdata.yml in ASI folder
  1. move userdata.yml from ASI folder to Kassi folder
  2. open console in Kassi (in production or development environment depending on to which Kassi env you are migrating the data)
  • Copy & Paste the lower part of the script to Kassi console. It will read the userdata.yml and store the data to Kassi db.
  1. edit your config.yml again
  • now set use_asito false, as ASI connection is not needed anymore
  1. edit person.rb again and remove the temporary additional code that you pasted there earlier
  2. restart delayed_job workers if you have such running
  3. Start your Kassi server and check if everything works