-
Notifications
You must be signed in to change notification settings - Fork 15
Migration from using ASI to standalone Kassi
gnomet edited this page May 13, 2012
·
2 revisions
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).
- Shutdown the Kassi server process if running. The ASI server where you are migrating from, needs to be running and responding.
- Backup your databases if you want to be sure that nothing is lost
- e.g.
mysqldump -u root -p kassi_production > kassi_backup.sql
- You should have the code updated to latest version in master branch
- You should have run the migrations to update the Kassi DB
rake db:migrate
- 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
- 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
andif 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"]
- if you don't have
curl
command installed, install it. (In OS X it's by default) - 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
- 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
- move userdata.yml from ASI folder to Kassi folder
- 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.
- edit your config.yml again
- now set
use_asi
to false, as ASI connection is not needed anymore
- edit person.rb again and remove the temporary additional code that you pasted there earlier
- restart delayed_job workers if you have such running
- Start your Kassi server and check if everything works