Migrated VPS

black server racks on a room

When I started hosting this website on DigitalOcean about 9 years ago, the version of Ubuntu that was all the rage was 14.04 LTS. So I started my hosting journey with that. Pretty soon though, 16.04 came along and since I was ever active on my server, I upgraded to that using nothing more than a few apt update commands. Since then, other than a few forced efforts to secure the OS and install what I needed for experimentation, I didn’t do much to upgrade the underlying software.

So it happened that, when at the beginning of the year I tried to upgrade from PHP 7.3 to 7.4 (a process which failed), I was made aware of the fact that the chasm between where my software stack is and where it ought to be is rather large. I tried running a straightforward upgrade from 16.04 to 20.04. The blocker was mysql. Apparently, no matter what third party repos I tried, the upgrade from what I was running to whatever’s the current just wasn’t possible. Well, it may be possible, but it would not be easy. The recommended path, on multiple websites, forums, and blogs, was to just fire up a new VPS and migrate my websites and services manually. Daunting.

When I learnt of this, I realized that the amount of time and effort it would take was too much for me to give at that moment. Family needs and other projects held precedence. Right now, I wouldn’t say those needs have abated, just that I’ve adjusted to both those asks, and I’ve given myself enough time and another factor for this migration – money. DigitalOcean is a nice provider in that they’ll only charge me for what I use through the number of days that I use it. I know this is sort of the norm everywhere now, but it’s a nice-to-have and a nice-to-mention nevertheless. Instead of doing the entire migration within the span of a few hours, tiring myself, and increasing the odds of a failed migration, I spread the entire project over the last few days. I moved my other WordPress install first, the one whose failure wouldn’t affect me directly and personally. It’s a side project that we’ve gotten side-tracked from. I’d be totally fine if it craps out.

Moving WordPress seemed daunting, until I realized that I have a tool that can make it extremely easy. I’ve been backing up this website to Dropbox using UpdraftPlus for the longest time. It’s fast, easy, and totally a background process which has not needed my input since I set it up. I checked it out and sure enough, it’s got a pretty straightforward restore process too, included in the free version of the plugin. Of course, they offer paid tools for much easier migration. But I reckoned the free one has got to work just as well. UpdraftsPlus creates a bunch of separate zip files for the database, uploads, themes, plugins, and “other”. All you have to do to migrate is to create a fresh install of WordPress, install the plugin and drop the files into the interface and then hit restore.

This blog’s backup comes in at about 750 MB, while the other site is about 160 MB. I did the latter first, and since it stayed up just fine over the last few days, while for the first time in my life I ran two VPS in parallel in DigitalOcean, I ported over this blog as well as the other applications and sites which I wanted to keep. It ended up being a good housekeeping too, since most of the active nginx sites were not doing anywhere and thus were liable to be security issues. Plus, it gave me a chance to really start from scratch.

Over the years, I let the older VPS grow organically and get cluttered as all in-use systems do. When I was attacked by a script kiddie trying to get into this site and wreak havoc (at which they partially succeeded), I installed fail2ban and went aggressive with it, to the point where I got locked out of SSH quite a few times and had to recover via console. I installed multiple versions of node to run shortlived telegram bots or expressJS apps. I installed numpy to create a webUI for an experiment my brother wanted to run. I also created a series of scripts to run via cron – to periodically free up space and memory, to pull in data and recycle logs.

All of this had become a sore point for me anyways. The services running on the VPS often went down. The APIs responded only half the time. The downtime was somewhat acceptable till it wasn’t.

So this new VPS, well, I’ll run it as clean as I can for as long as I can. Of course, I’ll get hit by something or the other and I’ll have to respond with better security measures. But I wasn’t running any firewall before and ubuntu 20.04 seems to be running ufw by default, which is nice. I was also able to update PHP from v7.3 all the way to v8.0, which is nice, but came with it’s own set of challenges. One function in WordPress and another in a homegrown bookmarking tool were failing since they don’t work in PHP 8.0, so I had to spend some time figuring that out. But it’s good to have the latest software and to hope I’ll keep things updated better this time around.

All in all, a good experience. My old VPS is now sitting in shutdown mode. I’ll let it sit for a couple weeks, while I test out the new system and see if I forgot to move some settings or such. I know it’ll cost me almost twice as much for the month to run both machines in parallel, but it’s worth the peace of mind I’m getting.

Plus, this migration got me in touch with some projects I’d forgotten! I regularly use my liveblog, but completely forgot about “SomeDay”, a bookmark/linkblog of articles I didn’t finish reading and hope to, some day. It’s got an RSS feed and all, so maybe you can find something in there that you might want to read, today.

Links to everything currently hosted on my new VPS –

this blog

tempdeals.net

scratch.nikhco.in – a minimal writing tool with local browser storage and ability to start a TogetherJS session to collaborate with others in real time.

liveblog.nitinkhanna.com

someday.nitinkhanna.com – I haven’t read these articles yet. Maybe you should try?

How do you like them upgrades?

Every few days, my iPhone politely but firmly nudges me to ‘downgrade’ my iOS from iOS 10 to iOS 11. I say downgrade because that’s what iOS 11 is to me – a crappy OS that was shoved out with half baked ideas which work well for the latest and greatest iPhone, but not at all for any other device Apple supposedly still supports. Getting rid of that prompt requires careful jumping through a confusing menu that makes it too easy to accept a “sure go ahead with this change at night when no one is watching” option. Most of the time, I am able to do just that. But last night, in a haze of trying to actually use my phone, I must have hit the wrong button, because when I woke up, my phone had restarted and was magically on iOS 11.4.1. Yay.

Before I talk about iOS 11, I just want to say why I didn’t want to get on it –

  1. It’s terribly built – simple features such as the ability to close apps quickly (in a few years time, Apple will reveal that just like their battery nonsense, closing apps DOES actually increase the speed of the phone, as empirically witnessed by a Bajillion people), the ability to turn off the wifi completely through the Control Center, the ability to actually use the phone for half an hour without draining the battery completely (my wife got on iOS 11 as soon as it released and she had the worst experience possible with that OS) were nice to have in iOS 10.
  2. I won’t be able to use all my apps – Apple, with iOS 11, waged a war on 32 bit apps. Now, most apps (99.9% I’d say) were smart about it and went 64bit, but I still have 4 apps on my phone, two of which I was using every few days till yesterday, which are 32 bit. So long Stress Baal and Sunstroke. You will be sorely missed.
  3. It will most certainly screw up my Apple Watch – I have a Series 0 (zero) Apple Watch. When will I buy the new one? Probably not for another few years. It’s a watch. It’s somewhat smart and lets me see messages and cut phone calls, but that’s about it. Do I need LTE? If AT&T pays me $15/mo instead of charging it from me, I might. But one minute into using the new OS, I was told to update my Watch from version 3.2.3 to 4.3.2 and told that if I do not, the phone will force unpair my watch and reset it. Thanks Obama. I exited the Watch app on my phone and plan on opening it at some point in the future. My watch is no longer getting notifications and isn’t able to send heart rate data to the phone (so much for Apple’s “we’re helping you take care of your health” crap. If the data collection is conditional, it’s not really helpful, is it?). But I know that watchOS 4 will screw up the watch, the third party apps, the battery usage. Basically, this is Apple’s way of making you buy a new watch. NO.

Now, coming to iOS 11. I immediately noticed that most apps seem to work differently – Google Maps had some new and interesting UI changes, Egg Inc had AR, the photos app had an irritating number of new features it had to tell me about before it let me use the app, the screenshots were showing up at the bottom (which is nice), etc.

Oh wait, backup. AR. That gleaming, new, awesome technology that’s changing the world! Yeah, I used it. For about 30 seconds. Then I was done.

Literally the only thing I could imagine using AR for – Egg, Inc. With that, my AR experience has ended. Well done, Apple.

Incidentally, I only recently watched this rather interesting video about how Apple will eventually launch AR glasses and they will be more successful than Google’s half-ass attempt because, well, Apple. It’s worth a watch 🙂 –

The rest of the stuff, is as I expected – meh. The app switcher can now close apps (yay!). The wifi stupidity that Apple propagated with iOS 11 is still there (so it’s always going to drain your battery no matter what). The animations and speed of launching apps is meh. Apple really wanted to make you feel something different, and well, I feel it, but I don’t care for it. It’s more a disruption than a nice addition. Plus, if you close an app that sits at the top of the screen vs at the bottom, the animation helps you see where the app is ‘going to’, but that’s really a rather stupid thing to care for Apple. I say that because I’m sure anyone who has as many apps as I do uses the search bar to get to apps instead.

Oh, yeah, that might be the silver lining – in iOS 10, I would swipe down, type out the name of an app I want, and the phone would just sit there, like a dunce, unsure of what I want it to do. Something was really borked in the code there and sometimes the search would work perfectly and other times it would go completely for a toss. Hopefully, that experience will be more consistent with iOS 11. If not, I’ll know that Apple did not even bother improving the Siri search code underneath and just dressed it in iOS 11 style. Typical Apple. Let’s see.

I’m no Luddite. I like experimenting with new stuff. But I really was hoping to go directly from iOS 10 to iOS 12. When iOS 12 drops, it’ll most likely not support my Series 0 watch. But at least it’s purported to be better than this monstrosity Apple threw our way. It’s OK to skip an OS, it’s OK to turn off auto-upgrades and auto-updates and watch your ‘to update’ App Store list burgeon to 197 apps. It’s OK to let the latest and greatest go while developers work on hardening releases. We all do it in some sphere of our lives. It’s just that my sphere was the one I’m staring at the most during my day – my phone. I want it to be consistent, familiar, and with less fluff. Sometimes people stick to a particular iPhone for a lot longer than they can, because they like the form factor and the materials used. Well, iOS 10 was that for me. But now my phone has moved past it. Time to adopt the new and shiny and see what changes this brings. Hopefully some nice AR filters.