Add create command to prevent external: true warnings #6203
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution Guidelines
What does this PR include?
Short Description
This is related to #5970 and https://community.mailcow.email/d/2126-backup-restore/2
It adds
docker compose create
to the script which gets executed directly after the sync of the mailcow-dockerized directory. This way the Docker daemon on the remote side creates everything (so the volumes are "owned" by the remote side) and we get rid of the warningvolume "XYZ" already exists but was not created by Docker Compose. Use 'external: true' to use an existing volume
This is helpful especially if you use the script
create-cold-standby.sh
to migrate your mailcow installation to another server and don't want to get those warnings after the migration.Affected Containers
Script:
create-cold-standby.sh
Did you run tests?
Sure 😎
What did you test?
I modified the script like in this PR and tested it during a mail server migration.
What were the final results? (Awaited, got)
No more warnings like
volume "XYZ" already exists but was not created by Docker Compose. Use 'external: true' to use an existing volume
:Output on local side:
This is also "repeat-proof" so the command does not produce any additional output after everything has been created successfully on initial execution.
Output on remote side after starting the containers: