I have an invoice ninja installation on a server through softaculous. I now have another server and I want to transfer all my data to the new installation again through softaculous but I haven’t managed to find an easy way.
I tried to copy and paste the db from phpmyadmin without success.
In regards to migrating to another server … is there a step by step guide written for dummies somewhere?
Things like we recommend using mysqldump to migrate the data, while helpful to someone who knows the ins and outs of mysql, is going to land a lot of people in trouble … hmmm … let me rephrase that have landed keen people in big trouble …
Hello,
I have managed to complete successfully the migration; below are the steps i followed.
I exported the DB form the original destination through phpmyadmin.
I went to the new server and created a new empty database and gave it the name of the exported one.
I then created a new user, same credentials as the exported one.
I imported the db with no errors.
I then installed invoice ninja on the preferred domain name through softaculous.
Finally, I edited the env file to match the migrated DB and the app key.
Howdy! I was wondering, after exporting the database and then importing it back into the new system, is there any PHP commands that need to be ran for Laravel? Thanks!
Thanks! I actually ended up doing the following (going off memory) and everything worked perfectly:
Log into old mysql database as root via phpmyadmin (I spun up a phpmyadmin container in Portainer to do this), then export just the Invoice Ninja table.
Find the old APP_KEY you used and use that same one for the new setup (should be in your old .env or docker-compose.yml file)
Spin up the new containers with whatever environment database variables you want (except use the old APP_KEY) so that a brand new mysql container and database is created
Log into new mysql database via the same method as before, create a new table named the same as the old table that was exported, then import the exported SQL file (depending on size you may have to add the phpmyadmin environment variable of “- UPLOAD_LIMIT=256M”
Navigate to the privileges section of the newly created table, you’ll see that your defined mysql user is not attached to this table so we need to add it.
Using the console tab at the bottom of the phpmyadmin page you’ll grant your user permission to this table. The user that you set up in your .env file for your new mysql instance. GRANT USAGE ON *.* TO `your-new-user-name`@`%`; GRANT ALL PRIVILEGES ON `your-imported-table-name`.* TO `your-new-user-name`@`%`;
Exit phpmyadmin
Enter “docker compose down” in your terminal to stop and remove the new containers
Edit your .env file and change your DB_DATABASE and MYSQL_DATABASE variables to the name of your old (now newly imported) table name, then save
Back at the command line run “docker compose up -d && docker compose logs -f” to recreate your containers with the env changes and follow the logs to make sure you’re not getting errors.
This method also fixes issues people are getting with plugin errors for “mysql_native_password” when updating from mysql versions < 8.4 because you’re creating the new database container from the get go with the newer “caching_sha2_password”
Log in with your browser and enjoy your new instance of Invoice Ninja!