Comments (11)
You shouldn't be pulling into the container. All changes will be lost when (if) the container restarts unless you are mounting /opt/kimai into a volume.
You should be just need to change the tag in the docker-compose and run a
docker-compose stop kimai
docker-compose up --build
The container will re-use the db form the previous version and then run the migrations (https://github.com/tobybatch/kimai2/blob/master/tags/1.0/startup.sh#L71).
However, I just tested this and it failed. Let me investigate.
from kimai2.
Fix coming soon. Totally my fault. I copied instruction from the install docs for kimai without understanding what they did. In the install kimai creates the DB and then added the DB migrations to the DB because the schema is now up to date. /opt/kimai/bin/console -n doctrine:migrations:version --add --all
What I should have done is execute the migations that are needed, /opt/kimai/bin/console -n -vv doctrine:migrations:migrate --allow-no-migration
. I've fixed this and pushed new builds for the 0.9, 1.0 and 1.0.1 container images.
from kimai2.
@yayitazale The schema has become out of date, I'll try and find out why but for now if we apply all the migrations it will fail on the ones that have been already applied and bring the schema up to date.
Start the v 1.0.1 container and shell into it
docker-compose exec kimai bash
Run all the migration, there wil be errors but we can ignore them.
for x in 20180701120000 20180715160326 20180730044139 20180805183527 20180903202256 20180905190737 20180924111853 20181031220003 20190124004014 20190201150324 20190219200020 20190305152308 20190321181243 20190502161758 20190510205245 20190605171157 20190617100845; do ./bin/console doctrine:migrations:execute -n $x; done
I am refactoring the containers At the moment. I'll make surebetter migration support is included.
from kimai2.
A bit of a hammer based solution ;)
from kimai2.
Yes you will need to run the migrations. Back everything up and then start the q.o container and then shell into the container:
docker exec -ti NAME bash
and run:
bin/console doctrine:migrations:version --add --all -n
I'll leave this issue open as I will add this to the docker start script.
from kimai2.
It doesn't work. I followed the steps of DB updating:
git fetch --tags
git checkout 1.0.1
composer install --no-dev --optimize-autoloader
bin/console cache:clear --env=prod
bin/console cache:warmup --env=prod
bin/console doctrine:migrations:migrate
The comand "git checkout 1.0.1 " says
error: Your local changes to the following files would be overwritten by checkout:
composer.lock
Please commit your changes or stash them before you switch branches.
Aborting
And final step says nothing to migrate.
Running
bin/console doctrine:migrations:version --add --all -n
doesn't make any change, even forcing the recreation of the container.
What I'm doing wrong?
from kimai2.
Thanks, I'll give a try as soon as it is publish.
from kimai2.
This is still not working...
from kimai2.
Can you let me have your docker-compose file please (both before and after the version bump). Just redact the passwords.
from kimai2.
Before:
version: '3'
services:
mydb:
image: mysql:5.7
environment:
- MYSQL_DATABASE=kimai
- MYSQL_USER=kimaiu
- MYSQL_PASSWORD=kimaip
- MYSQL_ROOT_PASSWORD=changeme
volumes:
- mysql:/var/lib/mysql
command: --default-storage-engine innodb
restart: always
kimai:
image: kimai/kimai2:0.9
environment:
- APP_ENV=prod
# These are added to override the the DB URL from env when checking the$
- DATABASE_URL=mysql://kimaiu:kimaip@mydb/kimai
depends_on:
- mydb
restart: always
ports:
- 80:8001
volumes:
mysql:
After
version: '3'
services:
mydb:
image: mysql:5.7
environment:
- MYSQL_DATABASE=kimai
- MYSQL_USER=kimaiu
- MYSQL_PASSWORD=kimaip
- MYSQL_ROOT_PASSWORD=changeme
volumes:
- mysql:/var/lib/mysql
command: --default-storage-engine innodb
restart: always
kimai:
image: kimai/kimai2:1.0.1
environment:
- APP_ENV=prod
# These are added to override the the DB URL from env when checking the$
- DATABASE_URL=mysql://kimaiu:kimaip@mydb/kimai
depends_on:
- mydb
restart: always
ports:
- 80:8001
volumes:
mysql:
from kimai2.
Many thanks, it works like a charm.
from kimai2.
Related Issues (20)
- [BUG] DemoBundle returns 404 in prod image for api endpoints HOT 6
- [FEATURE] Add Debian Package cron HOT 3
- [BUG] Emails not working HOT 12
- [FEATURE] Provide linux/arm64/v8 build HOT 1
- The latest version on Docker Hub seems to be v2.0.23. HOT 2
- [BUG] Kimai memory limit read as 500 bytes instead of MB HOT 2
- [BUG] 500 Internal Server Error HOT 2
- [BUG] Docker image PHP memory limit HOT 4
- [BUG] Image fails to build for ARMv7 & prevents new images from being published HOT 4
- [BUG] Release 2.0.28 / 2.0.29 HOT 1
- [BUG]Environmemt mailer not function HOT 1
- [Documentation] ReadMe on DockerHub contains faulty (legacy?) information on user creation HOT 1
- [BUG] Undefined constant Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_ALL HOT 1
- [BUG] Failed to validate database. Invalid platform version. HOT 15
- [BUG] Error 500 at Plugins after Upgrading HOT 1
- [BUG] Error 500 at plugins HOT 3
- [BUG] Doctrine DBAL - Invalid platform version HOT 1
- [BUG] DATABASE URL inconsistencies HOT 2
- Issue with "Easybackup" Plugin in Kimai Docker Environment HOT 4
- Kimai with Traefik as reverse proxy redirects to http when only https is set-up in docker-compose.yml HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kimai2.