I’m looking to migrate from v4 to v5 and while beeing busy installing v5 (via docker) I was wondering which of the env variables I can simply copy/paste from my v4 install.
here is my old .env file (btw. in v5 it seems to be called env without the . - did this change or am I supposed to copy the file after cloning the git repo?
# all .env variables are listed here:
# DB config
# APP config
# DB details for APP
# Email config
# Proxy configuration
#Google Maps integration
# Create a cookie to stay logged in
# Immediately expire cookie on the browser closing
# The app automatically logs the user out after this number of seconds
# password for mobile app usage
# adding my phantomjs API key
# details: https://github.com/invoiceninja/invoiceninja/blob/master/docs/configure.rst#phantomjs
# alternatively use a local instance
There are plenty of questions:
Oh, I noticed you have left the MYSQL variables inside docker-compose.yml - is there a particular reason why these have not moved to the env file?
and then I checked the hub: https://hub.docker.com/r/invoiceninja/invoiceninja
Those instructions seem more complete but are they for v4 or v5?
Hey there, environment variables mapping isn’t the same at v5. The best way would be to copy values manually.
If you’re using Invoice Ninja version 4, non-Docker, variables should be defined at the .env file.
For Invoice Ninja v5 it is the same unless you’re using the Docker, where it should be without the dot.
That’s just how Docker works.
To see all variables for version 5:
thanks for clarifying. I guess I messed up a bit with the env file. I was using v4 via docker and intend to do so again with v5.
My docker-compose.yml had used the .env file this way:
Thanks for this link, that was what i was looking for: https://github.com/invoiceninja/invoiceninja/blob/v5-develop/.env.example
Sure thing! Just copy the values of environment variables from docker-compose.yml (version 4) to env file for version 5. That should be fine.
thx. just wanted to mention that if you change docker-compose.yml with regards to app names/hostnames you have to edit config/nginx/in-vhost.conf and adapt this line with the correct hostname:
Getting errors like this when starting app (this is from the app container):
In Connection.php line 678:
SQLSTATE[HY000]  No such file or directory (SQL: select * from inform
ation_schema.tables where table_schema = ninja and table_name = accounts an
d table_type = 'BASE TABLE')
In Exception.php line 18:
SQLSTATE[HY000]  No such file or directory
It seems like somehow the env variables I have set aren’t picked up. Or maybe some service name is hard-coded somewhere and hence the initial IN tables aren’t created.
Here is how I have adapted my docker-compose.yml I like renaming my services and adapting the container names as well as the hostnames:
This is the relevant env file part:
# DB config
# DB details for APP
Hm, this is weird. But, if this setup works for you, just go with it. However, if you think you may help others with the same problem, please open an issue on github.com/invoiceninja/dockerfiles & we’ll do our best to adapt & accept this if it can be replicated. Thanks
I am still struggling with this part. It looks like when the IN db is starting up it is lacking the correct permissions to write to docker/mysql/data
according to the instructions: https://github.com/invoiceninja/dockerfiles I started with
git clone https://github.com/invoiceninja/dockerfiles.git
so now dockerfiles/docker/mysql/data is all owned by root as I executed the git command as root.
after entering the db container with
docker exec -ti db bash
I did a
id mysql command and found out the user ID of mysql is 999 so obviously that user ID has no permission.
How to fix this?
I think it’d be best for you to do this non-root. Docker should be able to operate as the non-root user just fine. Is there any reason for you to don’t use non-root user?
thanks but I see no difference.
lets say I am logged in as user ovi.
I do the git clone command as ovi, now all folders are owned by ovi.
I start IN as ovi, now all containers are running as user ovi.
The problem still persists that inside each IN container there are services which need the proper permissions to access the mounted volumes and I need to know which containers runs which services with which UUID/GUID
or am I missing something?
Um, really unsure haven’t seen this one before. Can you check is your user part of docker group?
@david can you help us with this?
I followed the instructions, please see the link I provided.
regarding docker group: if my user wasn’t in the docker group I couldn’t start the IN containers via docker-compose.yml