Migrating My WordPress Database from a Lightsail Instance to a Standalone Database

Last year, I moved this blog off of a EC2 instance running a too-old version of PHP to a Lightsail instance. I had to restart that instance in order to retrieve the images associated with all the prior posts so they looked exactly as they did before, but the end result was the same blog at a lower monthly cost. Since then, I installed and configured the WP Offload Media Lite plug-in to push all those images to an S3 bucket. Today I decided to move the WordPress database off the Lightsail instance to a standalone database.

Accomplishing this move required cobbling together instructions from Bitnami and AWS (and filling in any gaps with educated guesses). Here are the steps I took to get everything moved over, in the order I took them.

  1. Export the application database from the Lightsail instance. As of this writing, the Bitnami WordPress image still keeps database credentials in a bitnami_credentials file, so using that with the mysqldump command generated the file I would need to import to the new database (backup.sql).
  2. Download backup.sql to my local machine. Connecting to my Lightsail instance with sftp and my SSH key followed by “get backup.sql” pulled the file down.
  3. Download MySQL Workbench. Looking at these import instructions, I realized I didn’t have it installed.
  4. Create a Lightsail database. On the advice of co-workers who also do this with their side projects, I used us-east-2 as the region to setup in. I specified the database name to match the one in the backup.sql file to make things easier later when it was time to update wp_config.php.
  5. Enable data import mode. By default, data import mode is disabled and public mode is disabled. So I turned on data import mode and was puzzled for a second when I couldn’t connect to the database in order to import from backup.sql.
  6. Enable public mode. With public mode disabled, and my backup.sql file (and tools to import it) not already available in a us-east-2 hosted instance or other resource, I couldn’t load the backup data. Once I enabled public mode, I was able to use MySQL Workbench to connect and upload the data.
  7. Disable public mode.
  8. Update wp_config.php to use new database credentials.

To confirm that the post you’re reading now was written to the new database, I turned on the general query log functionality on the database instance to ensure that the server was writing to it. Having confirmed that, I turned off the general query log.

The additional cost of a standalone Lightsail database is worth it for the week’s worth of database backups you get with zero additional effort. Migrating to a newer WordPress instance in the future should be easier as well, now that both the database and media for the site are off-instance. The next step I need to take is upgrading from the lite version of WP Offload Media to the full one. This should offload all the media so I can safely remove it locally.

Exploring Mastodon Continued: Verification

As I mentioned at the end of my first post on Mastodon, I’ve been following Martin Fowler’s notes on his own journey.  His November 1 memo on verification interested me, especially in light of Twitter’s recent update to charge $8 for the blue check mark.

As Fowler explained it, Mastodon being decentralized (unlike Twitter) means verification is up to each server.  Whoever runs it can verify members however they wish–or not at all.  The approach to verification he describes and implements is what he calls cross-association.  By adding a <link> element to the <head> of his personal website with an href attribute for his corporate Mastodon profile, Mastodon “sees” the link and marks it as verified.

I followed Fowler’s example to do the same thing with my Mastodon profile.  I updated the header.php of the WordPress theme I’m using this way:

<head>
<meta charset=”<?php bloginfo( ‘charset’ ); ?>”>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<link rel=”profile” href=”//gmpg.org/xfn/11″>
<link rel=”me” href=”https://mastodon.cloud/@genxjamerican”>
<?php wp_head(); ?>
</head>

With that change made, my Mastodon profile now looks like this:
Mastodon profile with verified metadata for a website

This way, people who follow me on Mastodon know that I control this website as well.

Navigating the Latest Social Media Shakeup: Exploring Mastodon

In the wake of Elon Musk closing a deal to buy Twitter (after trying and failing to back out due to buyer’s remorse), the scramble to explore alternatives reminds a little bit of the very early days of social media.  I’m old enough to remember social networking sites like Friendster and Orkut, and there were plenty of others I’ve forgotten who never gained critical mass and flamed out.  I joined Twitter in 2009, and over the past 13 years it has grown to become the social media platform I find the most valuable.  Having heard people mention Mastodon in the past as an open source Twitter alternative (Trump Social even tried to use the codebase without attribution), I created an account—@genxjamerican@mastodon.cloud—to see how Mastodon compared for myself.

TL;DR

I’ve only been on Mastodon a week, but if I were to try and distill my advice of getting started into just a few points they would be:

  1. Follow @joinmastodon on Twitter first to start learning more
  2. Use a mobile app to smooth out (some) of the rough edges of the experience (including account creation)
  3. See if people you already follow on Twitter are cross-posting on Mastodon and follow them first

Signing Up

I don’t recall why I chose mastodon.cloud as the server to sign up with, but creating an account was straightforward enough.  It appears to be one of the largest Mastodon servers, along with mastodon.social, the original one operated by the German non-profit of the same name.  Using the official Mastodon mobile app, or one of the third-party apps makes the process a little slicker.  Stick with one of the largest servers unless you come across a particular server/community that really interests you.

Following People

I started by following people I know from Twitter who signed up for Mastodon and still post on Twitter.  The Fedi.Directory is where to look for interesting accounts to follow.  Their account (@FediFollows@mastodon.online) has been a good one to follow for someone like me just starting out.

Unfollowing, muting, blocking, and reporting all appear to work similarly to the way they do on Twitter (though I’ve had no need to do any of those things after so short a period of time).

Enough Lurking, Time To Post

A post (or a reply to a post) in Mastodon is called a toot, and they can be up to 500 characters long.  Sharing the post of someone you follow is called a boost.  You can favourite posts as well, though that only puts the toot in a list of your favourites (instead of sharing that fact with whoever follows you).  You can add content warnings (CWs) to your posts, so someone has to click through to see the content.

Posts can include pictures, but it doesn’t look like you can post videos. I follow @AmiW@mastdon.online and she posts pictures of street art from all over the world.

You can also send direct messages to people–if their accounts allow it.

There does not appear to be any such thing as quote-“tooting”.

What’s Next?

For me, spending more time on Mastodon exploring the features and looking for bigger and better guides to and explorations of Mastodon by others.

Martin Fowler is writing a whole series of posts on his exploration of Mastodon that I’ll be following with great interest.

New MacBook Pro

The untimely death of the mid-2015 MacBook Pro that had been my primary machine the past few years meant I forking over for another laptop. Given the hassles that resulted from buying that machine from somewhere other than Apple or MicroCenter, I didn’t take any chances with its replacement.

A refurbished version of this laptop (where I wrote this post) cost a little over $400 less than retail. I’m still in the process of setting things up the way I like them, but one new thing I learned was that Apple is still shipping their laptops with an ancient version of bash.

Having used bash since my freshman year of college (way back in 1992), I have no interest in learning zsh (the new default shell for macOS). So right after I installed Homebrew, I followed the instructions in this handy article to install the latest version of bash and make it my default shell.

There’s still plenty of other work to do in order to get laptop the way I want it. Data recovery hasn’t been difficult because of using a few different solutions to back up my data:

I’ve partitioned a Seagate 4TB external drive with 1TB for a clone of the internal drive and the rest for Time Machine backups. So far this has meant that recovering documents and re-installing software has pretty much been a drag-and-drop affair (with a bit of hunting around for license information that I’d missed putting into 1Password).

I wasn’t a fan of the Touch Bar initially, even after having access to one since my employer issued me a MacBook Pro with one when I joined them in 2017. But one app that tries to make it useful is Pock. Having access to the Dock from Touch Bar means not having to use screen real estate to display it and means not having to mouse down to launch applications.

Because of Apple’s insistence of USB-C everything, that work includes buying more gear. The next purchase after the laptop itself was a USB-C dock. I could have gone the Thunderbolt dock route instead, but that would be quite a bit more money than I wanted or needed to spend.

Even without the accessories that will make it easier to use on my desk in my home office, it’s a very nice laptop. Marco is right about the keyboard. I’ll get over the USB-C everything eventually.

Free Software for Your New Computer

If you’ve bought a new PC or Windows laptop recently, it probably came “bundled” with a bunch of free software.  It is a near certainty that the bundled software you got is awful.  Most people I know who make their living from computers (the ones who use Windows instead of Mac OS X anyway) reformat the hard drive and install only what they need to avoid this junk.  Why this software is on your computer in the first place is another story.  This post is about where you can find free software you actually want on your computer.

The Google Pack (http://pack.google.com) is a great place to start adding software you actually need.  As of this writing, the pack contains 14 applications.  This includes applications like Adobe Acrobat Reader, Firefox, Picasa, Skype, and RealPlayer.  The biggest benefit of adding these applications to your new computer via Google Pack is the updater software.  You can configure it to automatically update applications when there are new versions.

Open Source Windows is another great source for free software.  Unlike the Google Pack offerings, none of the software you’ll find at Open Source Windows is offered by Google.  The types of software are broader in many ways as well.  They include instant messaging (IM) clients, RSS clients, video playback, sound recording, graphics/photo editing, even games.

So if you’ve got a new Windows machine you need to get running, get rid of the bundled software and pay those sites a visit.  It will only cost you a little time, and the quality of the software you’ll get in return makes it a worthwhile investment.

Alternative PDF Readers

According to an article I got from my boss, there is a flaw in Adobe Acrobat and Adobe Acrobat Readers that will allow hackers to take over your machine if you open a PDF file they send you.  The article only mentions Windows XP Service Pack 3 as a vulnerable OS, so it’s unclear whether Vista can be taken over this way as well.  Despite how serious this flaw is, a fix for it won’t be available until March 11.  Between now and then, you can either swear off the opening of PDFs entirely, or use an alternative PDF reader.

Those of us using Mac OS X (which understands the PDF format natively) need only make sure that Preview or Safari is the default PDF reader.

In Search of Wireless Internet

Recently, I’ve gotten a couple of questions from family about where they can get wireless internet access.  People usually mean wi-fi when they ask this.  I tend to address this problem by location–either you want wireless internet when you’re at home, when you aren’t, or both.

The variety of places offering wi-fi is definitely increasing.  Beyond the usual suspects (Starbucks, Panera Bread, airports and hotels), it’s showing up in other places (e.g. downtown Silver Spring).  If you want to find the nearest wi-fi offerings in your zip code, visit http://hotspotr.com/wifi (thanks for the link Adrienne).  If there’s a charge for the wi-fi access, the service is mostly likely provided by one of the major cellphone service providers (Verizon, AT&T, T-Mobile).

For wireless access at home, you have your choice of any provider who offers broadband access.  For most of us, that provider will be a cable company like Comcast or a phone company like Verizon.  Either type of provider will be able to offer you a modem that provides wired internet access and wireless internet access.  They may try to charge extra for setting up more than one computer, but I recommend not paying.  You’ll be able to get a family member or friend to help you for free, or a local high school or college student for a lot less than Comcast or Verizon will charge.

Alternatives to Microsoft Office

My dad asked me yesterday if there were any free alternatives to Microsoft Office.  The one that came to mind right away was OpenOffice.org.  Writer, Calc, Impress, Draw and Base are the OpenOffice.org answers to Word, Excel, PowerPoint, Visio and Access.  The suite is free, open source, and available for Windows, Mac OS X, Linux, and Solaris.

If you’re ready to embrace cloud computing, even more options are available to you.  Google Docs offers word processing, spreadsheets, and presentation capabilities.  It does a nice job of handling Microsoft Word and Excel files.  Another alternative to the Microsoft Office suite comes from zoho.com.  It offers the same level of compatibility with Word, Excel, and PowerPoint of Google Docs or OpenOffice.org.  Zoho.com offers a wider variety of applications than Google Docs.  They use plug-ins to integrate with MS Office, Outlook, Internet Explorer, Firefox–even Facebook and smartphones (iPhone and Windows Mobile).

Free Tech Support

For family and friends of mine who don’t work with computers, I often act as free tech support.  To bring something a little different to this blog in 2009, there will be posts from time-to-time that share a question I’ve answered about technology for someone.