2017-07-05 12:05:40 +02:00
## Automatic update
An update script in your mailcow-dockerized directory will take care of updates.
But use it with caution! If you think you made a lot of changes to the mailcow code, you should use the manual update guide below.
Run the update script:
```
./update.sh
```
If it needs to, it will ask you how you wish to proceed.
Merge errors will be reported.
2018-02-01 21:53:58 +01:00
Some minor conflicts will be auto-corrected (in favour for the mailcow: dockerized repository code).
### Options
```
# Check for updates
./update.sh --check
# Update with merge strategy "ours" instead of "theirs"
# This will merge in favor for your local changes.
./update.sh --ours
2018-02-04 23:29:30 +01:00
```
2017-07-05 12:05:40 +02:00
## Manual update
2017-05-06 00:22:26 +02:00
2017-06-21 19:39:34 +02:00
### Step 1
2017-06-22 20:23:20 +02:00
You may want to backup your certificates, as an upgrade from an older mailcow: dockerized version may remove these files:
```
cp -rp data/assets/ssl /tmp/ssl_backup_mailcow
```
2017-05-09 17:54:50 +02:00
Fetch new data from GitHub, commit changes and merge remote repository:
2017-05-06 00:22:26 +02:00
```
2017-06-21 19:39:34 +02:00
# 1. Get updates/changes
git fetch origin master
# 2. Add all changed files to local clone
2017-05-06 00:22:26 +02:00
git add -A
2017-06-21 19:39:34 +02:00
# 3. Commit changes, ignore git complaining about username and mail address
2017-05-09 17:54:50 +02:00
git commit -m "Local config at $(date)"
2018-02-01 21:53:58 +01:00
# 4. Merge changes, prefer mailcow repository, replace "theirs" by "ours" to change merge strategy
2017-06-21 19:39:34 +02:00
git merge -Xtheirs -Xpatience
2017-05-06 00:22:26 +02:00
2017-06-21 19:39:34 +02:00
# If it conflicts with files that were deleted from the mailcow repository, just run...
git status --porcelain | grep -E "UD|DU" | awk '{print $2}' | xargs rm -v
# ...and repeat step 2 and 3
2017-05-06 00:22:26 +02:00
```
2017-06-22 20:23:20 +02:00
Check data/assets/ssl for your certificates (and dhparams.pem). If you miss them, recover your files:
```
cp -rp /tmp/ssl_backup_mailcow/* data/assets/ssl/
```
2017-05-06 00:22:26 +02:00
### Step 2
2017-05-13 10:34:50 +02:00
When upgrading from a version older than May 13th, 2017 to a version released after that date, you need to run the following command first as network settings have been changed:
2017-05-13 10:32:20 +02:00
```
docker-compose down
```
2017-05-06 00:22:26 +02:00
Pull new images (if any) and recreate changed containers:
```
docker-compose pull
docker-compose up -d --remove-orphans
```
### Step 3
Clean-up dangling (unused) images and volumes:
2017-09-14 17:30:33 +02:00
It is **very important** to _not_ run these commands when your containers are deleted.
Running `docker-compose down` - for example - will delete your containers. Your volumes are now in a dangling state! Running the commands shown below, _will_ remove your volumes and therefore your data.
2017-05-06 00:22:26 +02:00
```
docker rmi -f $(docker images -f "dangling=true" -q)
docker volume rm $(docker volume ls -qf dangling=true)
```
2018-04-19 19:34:34 +02:00
2018-04-19 19:51:04 +02:00
## Footnotes
2018-04-19 19:34:34 +02:00
2018-04-19 19:51:04 +02:00
- There is no release cycle regarding updates.