• Hi,

    I’m on the free version of Pretty Links and I’m trying to move my links into a fresh WordPress install (no 14‑year cruft) by moving only the needed database tables, not the whole site.

    What I’m trying to do

    • Keep live site as‑is for now.
    • On a separate fresh WP install, bring over only Pretty Links data so I can rebuild everything else cleanly.
    • Both installs are standard WordPress, same table prefix (wp_).

    What I did

    1. From the live site’s database, I exported the Pretty Links tables:
      • wp_prli_links
      • wp_prli_clicks
      • wp_prli_groups
      • wp_prli_link_metas
    2. On the fresh WP site:
      • Installed and activated Pretty Links free.
      • Confirmed it created its own wp_prli_* tables.
      • Dropped those empty tables and imported the wp_prli_* tables from the live export into the fresh site’s database (same wp_ table prefix, correct DB).
    3. Verified in the database on the fresh site:
      • wp_prli_links is full of valid rows (my links from live).
      • Other wp_prli_* tables are populated too.

    The problem

    • In the Pretty Links admin on the fresh site, the list shows All (0) and no links.
    • If I create a new test Pretty Link in the admin on the fresh site, it does not appear in the wp_prli_links table where my imported rows are.
    • wp_options on the fresh site does not have a prli_db_version row (I checked).

    So:

    • The data is definitely in wp_prli_links on the fresh site.
    • The plugin UI shows nothing and doesn’t seem to be reading or writing to the table I imported.

    What I’m not trying to do

    • I’m not trying to migrate the whole site or reuse a 14‑year‑old DB.
    • I do not want to use WP All Import/Export to pull everything over; I specifically want a clean WordPress install and to move just Pretty Links data if possible.
    • I’m on the free version, so I don’t have access to the Import/Export tab from Pro.

    My questions

    1. On the free version, is it officially supported to move Pretty Links by simply moving the wp_prli_* tables into a fresh install’s database (with the same table prefix), or is that guaranteed not to work?
    2. If it is supposed to work, what else does Pretty Links free rely on besides the wp_prli_* tables?
      • Are there specific rows expected in wp_options (like prli_db_version or anything else) that need to exist for the plugin to recognize existing data?
      • Is there any known behavior where Pretty Links will ignore existing rows in wp_prli_links on a fresh site?
    3. Is there any free‑version‑compatible way to get Pretty Links to recognize existing wp_prli_links data on a fresh install without buying Pro just for the Import/Export feature?

    If the official answer is “no, the free version does not support this pattern and the only supported way is via the Pro Import/Export tool,” I just need to hear that clearly so I can decide whether to pay for Pro for a one‑time migration or plan on replacing Pretty Links entirely if I have to manually copy links (don’t need click history) or pay $100 for a 1x migration.

    Thanks in advance for any guidance that applies specifically to the free version and to fresh‑install scenarios like this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author cartpauj

    (@cartpauj)

    The short version is that what you’re seeing is expected, and there’s a way to fix it for free. The reason your imported links don’t show up is that newer versions of Pretty Links don’t store links only in the wp_prli_links table anymore. Each link also has a matching entry in your wp_posts table as a custom post type (post_type ‘pretty-link’), and the two are tied together by the link_cpt_id column in wp_prli_links.

    The links list in the admin is actually the standard WordPress post list for that custom post type, so it reads from wp_posts and matches up to wp_prli_links using link_cpt_id. When you copied just the wp_prli_* tables, the link_cpt_id values in those rows still point at post IDs from your old site that don’t exist on the new one, so nothing matches and the list shows zero. Your data is definitely there, the admin just can’t connect it to anything.

    (Quick note on the new test link not showing in the table: it actually does get written to wp_prli_links, it just gets the next auto-increment ID so it lands after all your imported rows. It also creates its wp_posts entry at the same time, which is why it shows in the admin and your imported ones don’t.)

    To answer your questions directly:

    Moving just the wp_prli_* tables isn’t a supported migration path on its own anymore, specifically because the matching wp_posts entries don’t come along with it. Besides the tables, the plugin relies on those wp_posts rows (post_type ‘pretty-link’) plus the prli_db_version row in wp_options. And yes, any link whose link_cpt_id doesn’t match a real post will be ignored by the admin list.

    But you don’t need Pro to fix this. Pretty Links has a built-in routine that recreates the missing wp_posts entries for any links that don’t have one. We just need to tell it your imported links need that, and nudge it to run.

    Back up your database first, then on the new site (after importing the wp_prli_* tables) run these three queries in phpMyAdmin, Adminer, or wp db query. Change the wp_ prefix if yours is different:

    UPDATE wp_prli_links SET link_cpt_id = 0;

    DELETE FROM wp_options WHERE option_name = 'prli_db_version';

    INSERT INTO wp_options (option_name, option_value, autoload) VALUES ('prli_db_version', '21', 'yes');

    After that, just open any wp-admin page once. The plugin will notice the version is behind, create a post for each imported link, reconnect everything, and then update the version number on its own. Your links should all show up in the list after that, with click counts intact.

    What those lines are doing: setting link_cpt_id to 0 marks every imported link as needing a new post (the rebuild only touches links that don’t have one yet, so the old stale IDs have to be cleared). And resetting prli_db_version to 21 makes the plugin think it’s mid-upgrade so the rebuild kicks in on the next admin page load. Any value from 1 to 21 works as long as it’s there and below 22. If you have a lot of links, that first page load might take a few seconds while it builds the posts.

    A couple of things that should reassure you: your click history (wp_prli_clicks) and your groups (wp_prli_groups) carry over fine, so you won’t lose those. And your imported links were most likely already redirecting correctly even before any of this, because the redirect side looks links up directly by slug in wp_prli_links and doesn’t need the post entry. It was only the admin screens that couldn’t see them.

    Give that a try and let me know how it goes. If anything still looks off afterward, reply back with what you’re seeing and I’ll help you work through it.

    Thread Starter nycinsider

    (@nycinsider)

    Thank you so much – will be a few days/week before I move the post content to test. But this is a very thorough and welcome response. I love you think this is the ‘short” version, lol – not sure I ever want to see the long one!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.