Backup and restore Pretty Links manually on WordPress (without Pro)

I needed to move my Pretty Link data from one install to another, and plugin settings do not come along for a normal WordPress export so it needed to be done explicitly. Pretty Link Pro (a worthy purchase if you do much pretty-linking) is needed to do it via GUI the easy way, and I only have the pedestrian Free version.

So let’s see what we can do the hard way. You’ll need ssh access to the server and the wordpress database name, user, and password (findable in your wp-config.php).

Exporting

For a single-blog normal WordPress install Pretty Link data is stored in the following tables:

Else on a multisite WordPress install it’ll be more like this, with whatever numbers correspond to the blog on the network that you’re dealing with.

And after taking a look at the data within, it’s really what you’d expect: a list of urls to translate into other urls. Easy peasy, let’s export the explicit list of prli table names (changing as appropriate for multisite)

Now is the time to open up Vim and change some things if necessary. If doing migration between single wordpress installs, the tables names can stay the same. If you’re moving to another install of the same domain name, those can remain too. If going from normal to multisite, or from differently-numbered multisite blogs, you’ll need to edit the table names. If changing domains you’ll probably want to replace occurrences of the old domain name in all of the urls, or whatever. Up to you.

Then you can import.

Importing

Step one: back up your DB, dummy.

Step two: do something like this:

That’s all. Now you have your pretty links back. 😎