We are going to migrate our Lagotto instance to a new server running Ubuntu instead o CentOS.
Is there anything we need to consider beyond moving the MySQL and CouchDB databases?
Current plan is to do the following:
- Set up new VM with Ubuntu
- Install Lagotto from scratch as per documentation
- Replace CouchDB and MySQL databases with backups from old VM
Does that sound reasonable? Or are there other considerations to keep in mind?
I think there are several considerations:
- make sure to use Ubuntu 14.04, as this is the platform used for development and testing. This avoids annoying small differences between dev, testing and production platforms
- you can either setup a VM with Ubuntu and install lagotto manually, as per the instructions, or you can use Vagrant/Chef to install lagotto automatically if you are on one of the platforms supported by Vagrant (e.g. most larger cloud providers).
- I would install MySQL and CouchDB on a separate VM if possible. This gives you more flexibility in future upgrades, e.g. when you have to scale up the application.
The plan is to use Vagrant, to run things as closely as possible to what you are using for development and testing. Do you recommend to have MySQL and CouchDB each on their own VM? Or both on a single VM? What settings need to be specified for Vagrant to set up separate VMs?
CouchDB will no longer be needed in the Lagotto 4.0 release, so it is easier to have MySQL and CouchDB on the same VM. I recommend to install MySQL manually on a separate VM. Provisioning multiple VMs with Vagrant is a bit painful, and not needed in this case, as installing and configuring MySQL should be straightforward.
Another option that I have started to work on, but need another 1-2 months is Docker. In contrast to Vagrant, VMWare vSphere is supported by docker-machine. Depending on your configuration, this might be an interesting option, but is currently a bit cutting edge.
Thanks. I will go with the setting up MySQL and CouchDB on a manually configured VM for now and pointing the .env file to it, then using Vagrant for the rest of the install.
I installed with Vagrant and it installed everything into a single VM. Then I created a new VM with MySQL and CouchDB and loaded the data from the old instance in there.
I thought I would just have to update the .env file to point to the new DB VM and to a
vagrant provision, but that does not seem to be working.
I also tried re-installing with the .env file pointing to the DB VM, but that fails on MySQL.
What am I missing? What's the right way to update the configuration to point to the new location of the databases? Or how do I indicate that MySQL is already installed?
What you are probably missing is opening up MySQL and CouchDB to be accessible over the network and not just from localhost. You have to change
/etc/mysql/my.cnf and in
/etc/couchdb/local.ini to the IP of the Rails application server. And you have to change
.env, as well as
COUCHDB_URL, but it sounds as if you have already done the latter.