I wrote the script originally, and just posted it to the forums (and the Trello page way back when) where it ended up getting added to the documentation by Hillel.
Backup functionality was left out on purpose, since using mysqldump could fail if the Invoice Ninja user didn’t have the proper roles assigned in the database. I also wanted to leave it up to the user to decide if/how they wanted to run the backup (I also didn’t like the idea of pulling their credentials from the .env file).
That being said, more choices are always a good things (which is why we have the script, ansible, docker, softaculous, etc.), and I’d love to see how you implemented it. I’d say just throw it in Pastebin and post a link here. It will definitely be nice to have another option!
Sorry, didn’t notice that I got a response.
The Paste: upgrade script
I don’t think mysqldump can fail, as it requires the same permissions as the invoiceninja user.
I think it is a good idea to pull the auth data from the .env file, as it doesn’t requiere manually entering that stuff and I don’t see any security implications.
I couldn’t get around to thorougly test the newest version, but feel free to test it out.
The script basically does the following:
1. Extract the DB_USER, DB_HOST, DB_NAME and DB_PASSWORD from the .env file
2. Create the tempdirs and backupdir(yyy-mm-dd)
3. Write the extracted data to client.cnf
4. Dump the database
5. Delete the client.cnf file
6. Backup the invoiceninja folder via rsync -a
7. Upgrade (nothing changed)