PostgreSQL (including Postgis) is required to run backupper.
Script to create tables in DB — cropio_api_structure.sql
This is the easiest way to run the backupper on any OS (macOS, Linux, Windows/WSL2). It starts everything for you — the backupper and PostgreSQL (with PostGIS) — so you don't need to install Ruby or PostgreSQL locally. Only Docker is required.
-
Install Docker (Docker Desktop already includes Compose).
-
Create your config from the template and fill in the values:
cp .env.example .envEdit
.envand set eitherAPI_TOKEN, or bothCROPIO_LOGINandCROPIO_PASSWORD.DB_HOSTis set automatically by Compose — leave it out. -
Start everything:
docker compose up --buildOn first run the database schema from
cropio_api_structure.sqlis loaded automatically. The backupper waits until PostgreSQL is healthy before it starts downloading. -
Useful commands:
docker compose logs -f backupper— follow the backupper logsdocker compose down— stop all services (database data is kept in thepgdatavolume)docker compose down -v— stop and delete the database volume (full reset)
-
install ruby-2.3.1, rubygems, bundler
-
run
bundle install -
add required environment variables:
DB_NAME=cropio_api DB_PORT=5432 DB_USERNAME=cropio DB_PASSWORD=cropio DB_HOST=localhost START_DOWNLOAD_YEAR=2015 DOWNLOAD_PERIOD=year (year by default, you can choose: hour, day, week, month, year) DB_SCHEMA=your database schema name -
either
API_TOKENor bothCROPIO_LOGINandCROPIO_PASSWORDcan be used to log in -
run
bundle exec rake download_data
SatelliteImageandVersionare heavy and rarely used objects and disabled for downloading by default, but you can set env variable to turn on downloadingADDITIONAL_MODELS=SatelliteImage,Version
-
Install Docker for CentOS
-
Pull image from Docker Hub
docker pull cropio/cropio-backupper -
Launch
- Container launch command example (you must specify logins and passwords in variables)
or in case you decide to use
docker run -e "CROPIO_LOGIN=" -e "CROPIO_PASSWORD=" \ -e "DB_NAME=" -e "DB_SCHEMA=" -e "DB_PORT=" -e "DB_USERNAME=" -e "DB_PASSWORD=" -e "DB_HOST=" \ --restart=always cropio/cropio-backupperAPI_TOKENdocker run -e "API_TOKEN=" \ -e "DB_NAME=" -e "DB_SCHEMA=" -e "DB_PORT=" -e "DB_USERNAME=" -e "DB_PASSWORD=" -e "DB_HOST=" \ --restart=always cropio/cropio-backupper - Show log
docker ps- show all running containersdocker logs [DOCKER_ID]- fetch the logs of specified container
- Container launch command example (you must specify logins and passwords in variables)