To do this, follow these steps:
result = Wallet.all.map { |m| m.attributes.except('created_at', 'updated_at') }.map { |r| r.transform_values! { |v| v.is_a?(BigDecimal) ? v.to_f : v } }
result.each do |w|
w.except!('settings_encrypted', 'id')
w['settings'] = Wallet.find_by(address: w['address']).settings
w['kind'] = w['kind'].to_s
end
File.open("config/seed/wallets_backup.yml","w") do |file|
file.write result.to_yaml
end
Wallet.delete_all
config/seed/wallets_backup.yml
in the config/seed/wallets.yml
.rake db:migrate db:seed
. It will migrate DB and seed wallets into Peatio.To do this you will need to process this steps:
bundle exec rake export:wallets
bundle exec rake export:addresses
config/seed/wallets_backup.yml
in the config/seed/wallets.yml
.rake db:migrate db:seed
. It will migrate DB and seed wallets into Peatio. bundle exec rake import:addresses['file_name.csv']