• Resolved mjayas

    (@mjayas)


    Thanks for a great plugin. I just upgraded from 0.3 to 0.4 today and ran the “/wp-admin/?migrate_p2p” command. At first I was kicked out to the login screen, which kept looping back on itself.

    I closed the tab and logged in again without the “redirect” variable in the URL, tried the migration once more, and this time it appeared to work, stating “44 connections migrated” (or something like that). However, when I check on posts (custom post types) that I had previously successfully made “connections” with, the connected posts were no longer displaying in the Edit screen, but instead the right column widget now shows “No connections.”

    There’s a lot of work I’d have to redo if I have to start from scratch. Can anyone provide some tips on what might have gone wrong? I can dink around in something like phpMyAdmin just a bit if necessary, but I’m not terribly facile with manipulating MySQL tables.

    Many thanks for any help anyone can provide…

    -Mihira

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author scribu

    (@scribu)

    In phpMyAdmin, make sure you have two tables: wp_p2p and wp_p2pmeta

    Also, were the connections reciprocal?

    Thread Starter mjayas

    (@mjayas)

    Hi scribu — thanks so much for the quick response. I don’t seem to have either of those tables (in my case, wp_[prefix]_p2p or wp_[prefix]_p2pmeta). Could the prefixes be part of the problem? Also, of the two types of connections I had registered, one was reciprocal.

    For what it’s worth, I haven’t yet tried creating new connections to see whether they’ll save correctly, but I’m guessing that without those tables, they won’t save.

    I’d really appreciate any further help you can provide! Thanks for a clean, simple, and powerful plugin. I hope I can get this working again quickly!

    Plugin Author scribu

    (@scribu)

    Firstly, you should restore a db backup from before you tried to migrate connections.

    Then, try running the following queries in phpMyAdmin:

    CREATE TABLE wp_[prefix]_p2p (
    	p2p_id bigint(20) unsigned NOT NULL auto_increment,
    	p2p_from bigint(20) unsigned NOT NULL,
    	p2p_to bigint(20) unsigned NOT NULL,
    	PRIMARY KEY  (p2p_id),
    	KEY p2p_from (p2p_from),
    	KEY p2p_to (p2p_to)
    )
    CREATE TABLE wp_[prefix]_p2pmeta (
    	meta_id bigint(20) unsigned NOT NULL auto_increment,
    	p2p_id bigint(20) unsigned NOT NULL default '0',
    	meta_key varchar(255) default NULL,
    	meta_value longtext,
    	PRIMARY KEY  (meta_id),
    	KEY p2p_id (p2p_id),
    	KEY meta_key (meta_key)
    )

    replacing of course ‘[prefix]’ with whatever you have.

    Thread Starter mjayas

    (@mjayas)

    Thanks scribu — unfortunately, I’m not sure if I have backups from before I migrated. (Alas — I’ll make sure to do that in the future!) I’m checking with my web host to see if they have a backup. If not, am I out of luck altogether?

    Thread Starter mjayas

    (@mjayas)

    Sadly, my web host has confirmed that they have no db backup either. I’ll just need to recreate all those connections, alas. (This is obviously a bug you’ll probably want to investigate, as it could be a major issue for your plugin’s users!)

    So, I guess I should just delete the plugin altogether from the WordPress control panel and just reinstall it, and the appropriate tables will be created?

    Thanks for any additional help you can provide…

    Plugin Author scribu

    (@scribu)

    De-activating and then re-activating the plugin should do the trick.

    If you can’t add connections afterwards, then run the queries I mentioned above and report back.

    Thread Starter mjayas

    (@mjayas)

    Yeah, de-activating and re-activating the plugin did the trick. Thanks for your help. Just a thought that you might want to consider adding a notice on the plugin page whenever you mention “migrating” that users should back up their databases before attempting to perform the “migrate” function. Indeed, I should have known this, but a reminder would have saved me a good chunk of time!

    In any case, though, thanks again for your help and for the excellent plugin.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Posts 2 Posts] Migrating from 0.3 to 0.4 not working; connections not appearing’ is closed to new replies.