wrolpi/UPGRADE.md

65 lines
2.8 KiB
Markdown
Raw Normal View History

2022-05-03 11:00:09 -06:00
# Upgrading WROLPi
# Table of Contents
* [Upgrading Docker containers](#upgrading-docker-containers)
* [Upgrading Raspberry Pi or Debian 12 Installation](#upgrading-raspberry-pi-or-debian-12-installation)
* [Upgrading a WROLPi Portable USB](#upgrading-a-wrolpi-portable-usb)
2022-05-03 11:00:09 -06:00
## Upgrading Docker containers
1. Stop docker containers
2022-05-03 11:00:09 -06:00
* `docker-compose stop`
2. Pull the latest master
* `git pull origin master --ff`
2022-05-03 11:00:09 -06:00
3. Build all docker containers
* `docker-compose build --parallel`
4. Create the map volumes
Checking for icesheet table as current user. Importing maps as wrolpi user, then changing ownership to _renderd. Changing ownership of /opt/wrolpi as well. Creating pgpass for wrolpi user in debian 11. Install specific version of serve. Not echoing the echo. Updating cache directory in create_db.sh. Use python binary to run db upgrade. Install renderd.conf to /etc on RPi OS. Fetching DC map from wrolpi.org to avoid broken daily PBFs. Only get latest dc map if it doesn't exist. carto switched again?? Changing mod_tile directory to /var/cache/renderd/tiles for RPi OS. Copying renderd configs for RPi OS. Installing postgres 13 for RPi OS map. Changing title of feature matrix. Moving download link up in readme. Changing mod_tile to _renderd. Using unix socket rather than host connection. Getting openstreetmap-carto as _renderd user. Assigning ownership of gis db to _renderd in reset_map.sh. Creating _renderd db user. Using _renderd to run renderd on debian 11. Installing python modules that map requires globally. Upgrading db using venv. Installing nodejs which installs npm. Install npm/node after other dependencies. Updating apt so nodejs can be installed. Upgrading PyYAML in new venv. Installing pip via apt. Including bash binary for portability. Moving images link out of list. Moving download up on Readme. Removing map installation from readme. Installing specific version of carto. Creating venv for wrolpi project. Using venv to install requirements and run wrolpi's main.py. Logging upgrade script. Including upgrade script in Upgrade readme. Moving upgrade logic into separate script. This is necessary so and repo update will take immediate effect on the upgrade. Modifying and unifying Debian installation with RPi OS installation.
2023-02-23 12:09:19 -07:00
* `docker volume create --name=openstreetmap-data`
* `docker volume create --name=openstreetmap-rendered-tiles`
5. Turn on the database
2022-05-03 11:00:09 -06:00
* `docker-compose up -d db`
6. Upgrade the database
2022-05-03 11:00:09 -06:00
* `docker-compose run --rm api db upgrade`
7. Start all docker containers
2022-05-03 11:00:09 -06:00
* `docker-compose up -d`
## Upgrading Raspberry Pi or Debian 12 Installation
Checking for icesheet table as current user. Importing maps as wrolpi user, then changing ownership to _renderd. Changing ownership of /opt/wrolpi as well. Creating pgpass for wrolpi user in debian 11. Install specific version of serve. Not echoing the echo. Updating cache directory in create_db.sh. Use python binary to run db upgrade. Install renderd.conf to /etc on RPi OS. Fetching DC map from wrolpi.org to avoid broken daily PBFs. Only get latest dc map if it doesn't exist. carto switched again?? Changing mod_tile directory to /var/cache/renderd/tiles for RPi OS. Copying renderd configs for RPi OS. Installing postgres 13 for RPi OS map. Changing title of feature matrix. Moving download link up in readme. Changing mod_tile to _renderd. Using unix socket rather than host connection. Getting openstreetmap-carto as _renderd user. Assigning ownership of gis db to _renderd in reset_map.sh. Creating _renderd db user. Using _renderd to run renderd on debian 11. Installing python modules that map requires globally. Upgrading db using venv. Installing nodejs which installs npm. Install npm/node after other dependencies. Updating apt so nodejs can be installed. Upgrading PyYAML in new venv. Installing pip via apt. Including bash binary for portability. Moving images link out of list. Moving download up on Readme. Removing map installation from readme. Installing specific version of carto. Creating venv for wrolpi project. Using venv to install requirements and run wrolpi's main.py. Logging upgrade script. Including upgrade script in Upgrade readme. Moving upgrade logic into separate script. This is necessary so and repo update will take immediate effect on the upgrade. Modifying and unifying Debian installation with RPi OS installation.
2023-02-23 12:09:19 -07:00
1. Run the upgrade script
* `sudo /bin/bash /opt/wrolpi/upgrade.sh`
* (If the upgrade script does not exist, run the installation script: `sudo /bin/bash /opt/wrolpi/install.sh`)
## Upgrading a WROLPi Portable USB
A [WROLPi Portable](INSTALL.md#wrolpi-portable-live-usb) USB carries two
partitions: the ISO (boot) partition and a `persistence` partition — created on
the first boot — that holds your library, database, and configuration. To move
to a newer ISO without losing the persistence partition, use the
`scripts/wrolpi-usb.sh` tool from any Linux host (your own computer, or the
WROLPi USB itself booted on another machine).
1. Download the new `WROLPi-v*-amd64.iso` from [wrolpi.org](https://wrolpi.org).
2. Plug the WROLPi USB into a Linux host and identify its device node (e.g. `/dev/sdb`) with `lsblk`.
3. Run the upgrade:
* `sudo ./scripts/wrolpi-usb.sh upgrade WROLPi-v<version>-amd64.iso /dev/sdX`
4. Eject the USB and boot it to verify.
The tool backs up the current partition table to `/tmp/` first, overwrites only
the ISO partition, and re-adds the `persistence` partition entry at its original
location. The ISO partition reserves 8 GiB of headroom so a larger future ISO
still fits ahead of the persistence partition.
### Converting an existing data drive is not supported
There is no in-place conversion of a drive that already holds your data into a
WROLPi Portable USB — flashing the ISO erases the whole drive. To turn a drive
you already use into a WROLPi USB without losing your files:
1. Back up everything on the drive to another disk.
2. Flash the whole drive with the ISO (`dd`/Etcher/Rufus — this erases it).
3. Boot once so WROLPi creates its persistence partition and sets itself up.
4. Copy your data into `/media/wrolpi/`, then let WROLPi refresh/repair to index the restored files.
Afterwards, future ISO upgrades preserve your library via the `upgrade` command above.