Skip to content

Commit 0dd11be

Browse files
committed
docs/Updates: Change full update procedure to recreate from templates
Previous procedure wasn't really a full update, but with the "Update only Docker images" procedure, full update can be made more complete. Even though it's more burdensome to users, as it removes any docker-compose.yml user made customization.
1 parent 22185bf commit 0dd11be

File tree

1 file changed

+43
-20
lines changed

1 file changed

+43
-20
lines changed

docs/Updates/index.md

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -118,38 +118,61 @@ encountered the same problem and reported the fix.
118118

119119
## Full update
120120

121-
Periodically updates are made to project which include new or modified container template, changes to backups or additional features. As these are released your local copy of this project will become out of date. This section deals with how to bring your project to the latest published state.
121+
Periodically updates are made to project which include new or updated container
122+
template, changes to backups or additional features. To evaluate if this is
123+
really needed, see the [changelog](Changelog.md) or [merged pull requests](
124+
https://github.com/SensorsIot/IOTstack/pulls?q=is%3Amerged). To apply all these
125+
changes all service definitions are recreated. As a drawback, this will wipe
126+
any custom changes to docker-compose.yml, may change semantics or even require
127+
manual migration steps.
122128

123129
!!! danger "Breaking update"
124-
Recent changes will require [manual steps](
130+
A change done 2022-01-18 will require [manual steps](
125131
../Updates/migration-network-change.md)
126132
or you may get an error like:
127133
`ERROR: Service "influxdb" uses an undefined network "iotstack_nw"`
128134

129-
## Quick instructions
130-
131-
1. shutdown your RPi, remove its storage medium and do a full image backup of
132-
it to another machine. Reinstall your storage and power up your RPi.
133-
2. backup your current settings: `cp docker-compose.yml docker-compose.yml.bak`
134-
3. check `git status` for any local changes you may have made to project files, ignore any reported "Untracked files". Save and preserve your changes by doing a commit: `git commit -a -m "local customization"`. Or revert them using: `git checkout -- path/to/changed_file`.
135-
4. update project files from github: `git pull -r origin master`
136-
5. recreate the compose file and Dockerfile:s: `./menu.sh`, select Build Stack, don't change selections, press enter to build, and then exit.
137-
4. get latest images from the web: `docker-compose pull`
138-
5. rebuild localy created images from new Dockerfiles: `docker-compose build --pull --no-cache`
139-
6. update running containers to latest: `docker-compose up --build -d`
135+
Full update steps:
136+
137+
1. Shutdown your RPi, remove the storage medium and do a [full backup
138+
image](https://www.howtogeek.com/341944/how-to-clone-your-raspberry-pi-sd-card-for-foolproof-backup/)
139+
of the storage to another machine. Reattach the storage back and power up
140+
your RPi.<br />
141+
NOTE: To skip this step may cause days of downtime as you debug a problem or
142+
wait for fixes.
143+
2. check `git status --untracked-files no` for any local changes you may have
144+
made to project files. For any listed changes, either:
145+
146+
1. Save and preserve your change by doing a local commit: `git commit -m
147+
"local customization" -- path/to/changed_file`, or
148+
2. Revert it using: `git checkout -- path/to/changed_file`
149+
150+
3. Update project files from github: `git pull -r origin master`
151+
4. Save your current compose file: `cp docker-compose.yml
152+
docker-compose.yml.bak`. NOTE: this is really useful, as the next step will
153+
overwrite all your previous manual changes to docker-compose.yml.
154+
5. Recreate the compose file and Dockerfile:s: `./menu.sh`, select Build Stack,
155+
for each of your selected services: de- and re-select it, press enter to
156+
build, and then exit.
157+
6. check the changes for obvious errors (e.g. passwords): `diff
158+
docker-compose.yml docker-compose.yml.bak`
159+
7. Perform the Docker image update procedure: ``` console $ docker-compose pull
160+
$ docker-compose build --pull --no-cache $ docker-compose up --build -d ```
140161

141162
### Troubleshooting: if a container fails to start after update
142163

143164
* try restarting the whole stack: `docker-compose restart`
144-
* backup your stack settings: `cp docker-compose.yml docker-compose.yml.bak`
145165
* Check log output of the failing service: `docker-compose logs *service-name*`
146166
* try googling and fixing problems in docker-compose.yml manually.
147-
* try recreating the failing service definition using menu.sh:
148-
1. `./menu.sh`, select Build Stack, unselect the failing service, press
149-
enter to build, and then exit.
150-
2. `./menu.sh`, select Build Stack, select the service back again, press
151-
enter to build, and then exit.
152-
3. Try starting now: `docker-compose up -d`
167+
* check how the container definitions have changed: `diff docker-compose.yml
168+
docker-compose.yml.bak`
169+
* try rebuilding your complete stack from scratch:
170+
1. check that you have a backup.
171+
2. stop and remove Docker containers: `docker-compose down`
172+
3. remove all menu generated files: `rm -r docker-compose.yml services`
173+
4. recreate the stack: `./menu.sh`, select Build Stack, select all your
174+
services, press enter to build, and then exit.
175+
5. try starting: `docker-compose up -d`
153176
* Go to the [IOTstack Discord](https://discord.gg/ZpKHnks) and describe your
154177
problem. We're happy to help.
155178

0 commit comments

Comments
 (0)