Title: [Plugin: Posts 2 Posts] All existing connection gone?
Last modified: August 20, 2016

---

# [Plugin: Posts 2 Posts] All existing connection gone?

 *  Resolved [Zhen](https://wordpress.org/support/users/milohuang/)
 * (@milohuang)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/)
 * Just upgraded to 1.1.3 and found all the existing connections are gone and I 
   have to click into every post to connect again. Wonder if it is a bug or there
   are some new features that I missed. PS. Is there a way to batch set up connections?
   Thanks!
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

Viewing 15 replies - 1 through 15 (of 35 total)

1 [2](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/page/2/?output_format=md)

 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459649)
 * If you were updating from P2P 1.0.1 or older, you should have seen a prompt to
   upgrade your connections as well. Are you on multisite?
 *  Thread Starter [Zhen](https://wordpress.org/support/users/milohuang/)
 * (@milohuang)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459665)
 * Thanks scribu, it looks like the previous update does work very well. I did seen
   the upgrade connection button but it said 0 connections were updated. Anyway,
   I will update those connections manually since there are just few of them. Thanks
   again for this great plugin!
 *  [Florian Mueller](https://wordpress.org/support/users/andromeda_media/)
 * (@andromeda_media)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459906)
 * Hi scribu, i have the same issue. I am on multisite and updated from 1.1.2. I
   am not sure if i got the update notice. But now all my connections are not showing
   in the damin boxes. They are still there and connected posts can be found in 
   frontend. But only the admin boxes are empty. Is it possible to do the connection
   updates manually somehow?
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459912)
 * Something really strange is going on. Another user reported that they see connections
   in the admin box, but not in the front-end:
 * [http://wordpress.org/support/topic/plugin-posts-2-posts-bug-in-113](http://wordpress.org/support/topic/plugin-posts-2-posts-bug-in-113)
 * You can check the p2p_type column in the wp_p2p table using phpMyAdmin.
 *  [Florian Mueller](https://wordpress.org/support/users/andromeda_media/)
 * (@andromeda_media)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459924)
 * Ok, i see that none of the connections has a p2p_type. What can i do now? I have
   1364 connections applied in the database (thats totaly correct 🙂 ). I can not
   change every connection by hand.
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459926)
 * If all the p2p_type columns are blank, then you shouldn’t see any connections
   on the front-end either.
 * You can try this:
 * 1. Go to `/wp-admin/options.php`
    2. Find the `p2p_storage` option. 3. Change
   the value to `3`. 4. Press `Update`.
 * You should then see a notice to upgrade the connections.
 *  [matthewcolab](https://wordpress.org/support/users/matthewcolab/)
 * (@matthewcolab)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459940)
 * Hi. I updated to wordpress 3.3 and upgraded the plugin to 1.1.3 and all my connections
   have been erased. They are still in the database, but in the admin screens AND
   on the front end, they are not showing up. I went to options.php and changed 
   the p2p_storage to 3 and was prompted to Proceed with updating the connections.
   However, when i click on that, it says “Upgraded 0 connections” and still my 
   posts are not connected.
 * The p2p table shows all the to and from connections with p2p types.
 *  [matthewcolab](https://wordpress.org/support/users/matthewcolab/)
 * (@matthewcolab)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459941)
 * Also, tried doing a `var_dump( post_type_exists( 'posttype' ) ); exit;` and it
   returned bool(false) bool(false) bool(false).
 * UPDATE: Sorry, my init priorities between custom post types and the registering
   p2p relation weren’t in the correct order. Now they are, and it’s returning true,
   but the problem still exists. No connections on admin panel or front end, but
   I can still see them in the database.
 *  [matthewcolab](https://wordpress.org/support/users/matthewcolab/)
 * (@matthewcolab)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459942)
 * Do you know what would cause it to not show the connections on the admin panel
   and front end, but they still exist in the database?
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459947)
 * So the p2p_type column is populated properly.
 * Do the P2P boxes in the admin not show up at all or do they show up with no connections?
 * Did you try adding `define( 'WP_DEBUG', true );` in your wp-config.php?
 *  [matthewcolab](https://wordpress.org/support/users/matthewcolab/)
 * (@matthewcolab)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459948)
 * The P2P boxes show up, just without the connections. I’m curious: what is the
   p2p_type column in the database? Is it a hash and how does it get generated?
 * This happened last time i updated, and i went in and manually redid the connections.
   They keep until updating this plugin, and the problem occurs again.
 * Debug mode showed a couple warnings, nothing really related:
 *     ```
       Notice: Undefined index: post in /mnt/target02/349133/606198/www.selectproperties.com/web/content/wp/wp-content/themes/selectproperties/functions/meta-box/meta-box-usage.php on line 449
   
       Notice: Undefined index: post_ID in /mnt/target02/349133/606198/www.selectproperties.com/web/content/wp/wp-content/themes/selectproperties/functions/meta-box/meta-box-usage.php on line 449
   
       Notice: automatic_feed_links is deprecated since version 3.0! Use add_theme_support( 'automatic-feed-links' ) instead. in /mnt/target02/349133/606198/www.selectproperties.com/web/content/wp/wp-includes/functions.php on line 3458
   
       Notice: Use of undefined constant core_mods - assumed 'core_mods' in /mnt/target02/349133/606198/www.selectproperties.com/web/content/wp/wp-content/themes/selectproperties/functions.php on line 42
   
       Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /mnt/target02/349133/606198/www.selectproperties.com/web/content/wp/wp-includes/functions.php on line 3578
       ```
   
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459952)
 * > what is the p2p_type column in the database? Is it a hash and how does it get
   > generated?
 * It’s the name of the connection type. If you don’t set the ‘name’ parameter when
   calling `p2p_register_connection_type()`, it generates a hash based on the other
   arguments.
 *  [matthewcolab](https://wordpress.org/support/users/matthewcolab/)
 * (@matthewcolab)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459953)
 * Firstly, thanks scribu you got me going in the right direction.
 * The issue ended up being that I wasn’t setting the name of the connection type,
   one of the paramaters that makes up the hash must have changed on update. This
   resulted in a different hash after the update, and the apparent “loss” of data
   that I was experiencing.
 * To fix without reentering data:
    I changed the name of my connection in the p2p_register_connection_type
   to whatever it was going to be, then looked in my wp_p2p table to find what the
   hash types hook up to using a query like this one:
 *     ```
       SELECT DISTINCT p2p_type,  fromtype.post_type AS fromtype,  totype.post_type AS totype
       from wp_p2p
       inner join wp_posts as fromtype ON wp_p2p.p2p_from = fromtype.ID
       inner join wp_posts as totype ON wp_p2p.p2p_to = totype.ID
       ```
   
 * Then after determining which hash type relates to which connection name, run 
   this on each one to update
 *     ```
       UPDATE wp_p2p SET
       p2p_type = "nameofconnection"
       WHERE p2p_type="f79b8d19b8b7dc1b5b357bd518c8d620";
       ```
   
 * Let me know if this ends up helping anyone having the same problem
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459954)
 * Note that you can find the current hash without doing a query:
 *     ```
       $my_connection_type = p2p_register_connection_type( array(
         ...
       ) );
   
       var_dump( $my_connection_type->name );
       ```
   
 *  [matthewcolab](https://wordpress.org/support/users/matthewcolab/)
 * (@matthewcolab)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/#post-2459955)
 * the problem wasn’t that we couldn’t figure out the current hash, the problem 
   I was experiencing was that the hash was changing – I needed to find a listing
   of orphaned hashes so that I could recover my relations without re-entering them.
 * Which I guess brings me to my next question: what paramaters get combined to 
   make the hash? I still don’t know for sure what paramater it was that changed
   to result in a different hash.

Viewing 15 replies - 1 through 15 (of 35 total)

1 [2](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/page/2/?output_format=md)

The topic ‘[Plugin: Posts 2 Posts] All existing connection gone?’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-to-posts_7a8e9d.svg)
 * [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-to-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-to-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-to-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-to-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-to-posts/reviews/)

 * 35 replies
 * 8 participants
 * Last reply from: [scribu](https://wordpress.org/support/users/scribu/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-all-existing-connection-gone/page/3/#post-2460137)
 * Status: resolved