How should I go about upgrading Ubuntu Server that my Rails application is running on?

I have an ubuntu-server running version: Ubuntu 14.04.5 LTS. I want to upgrade it to Ubuntu 18.04 LTS. I snapshotted my server and tried to upgrade it to 16.04, and then 18.04 but ran into some issues where it seems through the upgrades I lost some of my configuration files. When prompted by Ubuntu through the upgrades I chose to keep the local versions but I guess it didn’t ask about those configuration files. My question is what is a recommended approach to upgrading? I currently use passenger, nginx - are there any guides that discuss how to do this with that setup? Or am I better off creating a new server, setting it up and then redirecting to it? Another important note is this server/web application is for small internal usage. probably dealing with less than 30 users on a daily basis… I appreciate any guidance! Thanks!

If it were me, the leap from 14 to 16 to 18 would be too much to worry about so instead of upgrading a snapshot, I would just create the new server with 18 and then work on getting the app to run on it. Once it seemed to be running correctly redirect traffic to it.

Your approach should also work by keeping things very incremental - when you note that a configuration file seems to be missing refer back to the original server’s version and keep the new one as close to parity with the original as possible. There is too much information about updating and maintain legacy Rails apps out there to really make a specific recommendation for how to guides but the best place to start is simply reading the official Rails guides on updating/upgrading to see what you’re in for and that using that to google-fu for how-to articles that mirror your own situation.

Once you’ve got things running on a newer Ubuntu version come up with a plan for regular update maintenance because it’s much easier to update incrementally on a consistent basis than it is to just let a legacy app sit and accumulate huge amounts of technical debt. Good luck!

Generally you should look at the diff in these cases as it may be you had modified the original file and want to retain those mods. However you should not just retain your original as there may be new stuff in the new version that you need. Having looked at the diffs you can either use the new one, or apply your mods to the new one.

However you say the missing files are not ones you were asked about. Can you give examples of those?


My apologies but I have already reverted back to the snapshot. It seemed that my setup in /sites-enabled/ was only setup with a default file that wasn’t my original file after the upgrade. The reference to my ruby path was also incorrect. And I had to modify some permissions to log folders and such as redis-server couldn’t start because it couldn’t access some folders and files. I can’t remember the other ones as an example, but I’m going to clone the server and try again while going ahead and backing up the config files I’m aware of… see if I could get further along this time. I think I just need to backup my nginx.conf, and sites-enabled folder. That should be enough to get me back up and going. I do like the idea of creating the new server and just getting up and going that way, but not sure my team mate in charge of the servers feels the same way shrug. So I will try the upgrade again first.

If you put all your config files into a git repo it'll make it easier to see what's getting changed by the upgrade process.

It's all useful if you wind up going the new-server-reinstall-the-app route (which would be my preference).

HTH, and good luck!