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:
# https://github.com/invoiceninja/invoiceninja/blob/master/.env.example
###
# DB config
MYSQL_DATABASE=invoiceninja
MYSQL_ROOT_PASSWORD=
# APP config
APP_ENV=production
APP_DEBUG=false
APP_URL=https://
APP_KEY=
APP_CIPHER=AES-256-CBC
# DB details for APP
DB_USERNAME=root
DB_PASSWORD=
DB_HOST=mysql
DB_DATABASE=invoiceninja
# Email config
MAIL_HOST=smtp.gmail.com
MAIL_DRIVER=smtp
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAIL_FROM_NAME=""
MAIL_FROM_ADDRESS=
MAIL_USERNAME=
MAIL_PASSWORD=
# Proxy configuration
TRUSTED_PROXIES="172.17.0.0/16,somenetwork"
#Google Maps integration
GOOGLE_MAPS_ENABLED=true
GOOGLE_MAPS_API_KEY=
# Create a cookie to stay logged in
REMEMBER_ME_ENABLED=true
# Immediately expire cookie on the browser closing
SESSION_EXPIRE_ON_CLOSE=true
# The app automatically logs the user out after this number of seconds
AUTO_LOGOUT_SECONDS=1880
REQUIRE_HTTPS=true
# password for mobile app usage
API_SECRET=
# adding my phantomjs API key
# details: https://github.com/invoiceninja/invoiceninja/blob/master/docs/configure.rst#phantomjs
PHANTOMJS_CLOUD_KEY=''
# alternatively use a local instance
# https://www.invoiceninja.com/forums/topic/self-hosted-pdf-in-invoice-email-bad/#post-15319
#PHANTOMJS_BIN_PATH=/usr/local/bin/phantomjs
#PHANTOMJS_SECRET=
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.
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:
fastcgi_pass in-app:9000;
Getting errors like this when starting app (this is from the app container):
In Connection.php line 678:
SQLSTATE[HY000] [2002] 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] [2002] 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:
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
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.
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?
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