A user contacted me with the following problem: they have set up their databases during the Indigo Pro trial, and found that once the trial expired they couldn't start the stack and get to any of their databases, since they used a service that's only available in the Pro version.
This is obviously very unfortunate, and I'm mulling options to implement a solution to this, but in the meantime, you can back up your databases from the "pro-only" stack using the following process.
Note, there are a few parts to the following process that are less than ideal, so it really is intended only as a plan B. For example, for simplicity, the dump command dumps every database on the original mysql service, including mysql-system dbs. These will fail to restore, throwing errors which can be ignored but may be disconcerting. However, your personal databases should dump and restore quite solidly using these commands.
Back up all databases
Back up all databases from the Pro stack that will no longer start:
- in Indigo, select the stack that won’t start and right-click on the MySQL Service in the rack. Choose “Show Compiled in Finder”
- you should see a folder in the Finder called something like
mysql_XYZ
- open Terminal app and type
cd
(cd
followed by a space). Then drag the mysql_XYZ
folder you located above from the Finder into the terminal window.
- the command should now look something like
cd /Users/yourname/.indigo/stacks/pro-stackname/mysql_XYZ
. Press enter. This simply takes your terminal to the right folder.
- run this command to start up original mysql manually:
bin/mysqld --defaults-file=conf/my.cnf
- repeat the first few steps again in a new terminal window
- copy the following command into this new terminal window and run it. This will ask mysql to dump all your databases into one file on the desktop.
bin/mysqldump --defaults-extra-file=conf/my.cnf -u root -p --all-databases > ~/Desktop/all_databases.sql
Press return to run the command. It will request your mysql admin password, which is simply password
. Once completed you should see a new file on your Desktop called all_databases.sql
.
Restore all databases
Now, you can import this dump back into a stack that will start (using "Indigo Basic" services), using the following steps.
The following will recreate each database and all its tables. The import may fail if your destination mysql service already has DBs with the same name, so best to avoid that. Any existing DBs which have different names should be untouched. My advice would be to keep things as simple as possible and use a fresh empty mysql service in the destination stack if you can.
- repeat all the steps above, but this time for the destination stack's mysql service (that you can start up in Indigo Basic). You should now have a terminal window where you've run something like
cd /Users/yourname/.indigo/stacks/basic-stackname/mysql_1234
. Note, this is different than the source mysql used to dump the file.
Now you can run the restore command:
bin/mysql --defaults-extra-file=conf/my.cnf -u root -p --force < ~/Desktop/all_databases.sql
You'll see several errors as mysql tries and fails to restore some of the internal dbs that mysql sets up for itself (eg mysql.innodb_index_stats
). That is all fine.
Check the dbs
I highly recommend a GUI tool such as Sequel Ace which will allow you check your dbs are restored correctly into the new stack.