Skip to content

Vector Tile Runbook

Paul Norman edited this page Aug 23, 2026 · 8 revisions

Reloading the database for spirit updates

Pre-reload prep

  1. Comment out the vector backend from opentofu-fastly
  2. Push a commit and deploy the new config
  3. Update chef for the server role to set the [:vectortile][:replication][:enabled] and [:vectortile][:replication][:tileupdate] attributes to false, as well as updating the version of spirit and/or themepark.

Reload

Via SSH

  1. Start a screen session to protect against disconnections
  2. Stop tilekiln with sudo service tilekiln stop
  3. Remove any monitoring connections and drop the database with sudo -u postgres psql -d postgres -c "select pg_terminate_backend(pid) from pg_stat_activity where datname = 'spirit'" && sudo -u postgres dropdb spirit
  4. Update columns or drop tiles DB if schema columns have changed, e.g. psql -d tiles -c 'DROP SCHEMA tilekiln CASCADE';
  5. Download the latest planet to your home directory
  6. Check that chef has recreated the spirit database with psql -l and that the version of street spirit is correct
  7. Import the planet file with sudo -u tileupdate import-planet --cache 60000 <planet file pbf>. Adjust the --cache parameter if needed.
  8. Restart the osm2pgsql prometheus exporter with sudo service prometheus-osm2pgsql-exporter restart
  9. Set [:vectortile][:replication][:enabled] to true for the node and wait for chef to update
  10. Wait for replication to catch up
  11. OPTIONAL Delete existing tiles with sudo -u tileupdate /opt/tilekiln/bin/tilekiln storage delete --config /srv/vector.openstreetmap.org/spirit/shortbread.yaml --storage-dbname tiles. See not yet written section for more options
  12. Set [:vectortile][:replication][:tileupdate] to true
  13. Run daily low-zoom re-render

Clone this wiki locally