Skip to content

Batch Upload

eltonstewart edited this page Dec 29, 2014 · 19 revisions

Instructions on how to batch upload to the store.

Steps

  1. zip images on dropbox - will need time to sync with dropbox 1hr or more
  2. Finalise spreadsheet
  3. SSH to app server
  4. on the app server prepare a temp folder for uploading
  5. wget the zip of images
  6. unzip the file
  7. wget the spreadsheet
  8. backup the db
  9. run the spreadsheet import rake task
  10. have a quick look in spree to see it was imported ok
  11. run image import scripts: styleit, moodboard, customizations, songs, perfume, product photos
  12. have a quick look in spree to see it was imported ok
  13. when the product looks good, set the available date for yesterday
  14. reindex and refresh cache

Back up the db

SSH to the db server

sudo -i eybackup -e postgresql -n ey ssh 'sudo -i eybackup -e postgresql -n' -e production_new --database_master


SSH and App Server

Use terminal screen util to maintain sessions on server.

To create temp content folder

mkdir contentuploads

  • cd into
  • wget spreadsheet
  • wget images zip
  • unzip images zip into a new folder

To run rake tasks

cd /data/fame_and_partners/current


Rake tasks

FILE_PATH= the location of the spreadsheet on the app server.

LOCATION= the location of the images folder on the app server.

Spreadsheet

bundle exec rake import:data FILE_PATH=

Images: Accessories

bundle exec rake import:accessory:images LOCATION=

Images: Customisations

bundle exec rake import:customization:images LOCATION=

Images: Moodboards

bundle exec rake import:moodboard:images LOCATION=

Images: Perfume

bundle exec rake import:perfume:images LOCATION=

Images: Products

bundle exec rake import:product:images LOCATION=

Images: Songs

bundle exec rake import:song:images LOCATION=

Cached & Reindex

There is a button to refresh cache in spree admin https://www.evernote.com/shard/s109/sh/2790a893-77b3-4b9b-aee6-b53534578113/46980f2d85ff9e0d00914ecbba372e70

Spreadsheet notes

The file should look like this to work:

  • First column contains SKU
  • Second contains price ONLY for new products
  • File has no empty lines