{"id":11489,"date":"2018-04-23T11:43:33","date_gmt":"2018-04-23T15:43:33","guid":{"rendered":"https:\/\/upstreamplugin.com\/?post_type=knowledgebase&#038;p=11489"},"modified":"2018-04-23T13:18:16","modified_gmt":"2018-04-23T17:18:16","slug":"database","status":"publish","type":"knowledgebase","link":"https:\/\/upstreamplugin.com\/docs\/database\/","title":{"rendered":"Understanding the UpStream Database Structure"},"content":{"rendered":"<p>This is a guide to understanding where data is stored by UpStream.<\/p>\n<p>First, take a look at a Project. In this example below, the name of the Project is &#8220;Blog Posts&#8221;.<\/p>\n<p>If I click on the title of this project, the URL of the project is\u00a0\/wp-admin\/post.php?post=9&amp;action=edit. This tells us that the ID of the project is 9.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full shadow wp-image-11490\" src=\"https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/blog-posts-project.png\" alt=\"An UpStream project\" width=\"455\" height=\"199\" srcset=\"https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/blog-posts-project.png 455w, https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/blog-posts-project-300x131.png 300w\" sizes=\"auto, (max-width: 455px) 100vw, 455px\" \/><\/p>\n<p>Go to your WordPress site&#8217;s database and look for the wp_posts table.<\/p>\n<ul>\n<li><a href=\"https:\/\/codex.wordpress.org\/Database_Description#Table:_wp_posts\">This WordPress.org page has an overview of the wp_posts table<\/a>.<\/li>\n<\/ul>\n<p>You will see that every project is stored as a post. In the screenshot below, the ID of the project is 9 and the post_title is &#8220;Blog Posts&#8221;.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full shadow wp-image-11491\" src=\"https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/blog-post-db-project.png\" alt=\"wp_posts table with projects in the UpStream database\" width=\"660\" height=\"564\" srcset=\"https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/blog-post-db-project.png 660w, https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/blog-post-db-project-300x256.png 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<p>Now go to the wp_postmeta table.<\/p>\n<ul>\n<li><a href=\"https:\/\/codex.wordpress.org\/Post_Meta_Data_Section\">This WordPress.org guide explains what Post Meta is in WordPress<\/a>.<\/li>\n<li><a href=\"https:\/\/codex.wordpress.org\/Database_Description#Table:_wp_postmeta\">This WordPress.org page has an overview of the wp_postmeta table<\/a>.<\/li>\n<\/ul>\n<p>In the wp_postmeta table, look for database rows that have the Post ID of 9. This shows you all the data attached to the &#8220;Blog Posts&#8221; project. In the screenshot below, you can see that this data includes:<\/p>\n<ul>\n<li>_upstream_project_activity<\/li>\n<li>_upstream_project_milestones<\/li>\n<li>_upstream_project_tasks<\/li>\n<li>_upstream_project_bugs<\/li>\n<li>_upstream_project_discussion<\/li>\n<li>_upstream_project_progress<\/li>\n<li>_upstream_project_members<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full shadow wp-image-11493\" src=\"https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/post-meta.png\" alt=\"Rows attached to project in the UpStream database\" width=\"924\" height=\"537\" srcset=\"https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/post-meta.png 924w, https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/post-meta-300x174.png 300w, https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/post-meta-768x446.png 768w\" sizes=\"auto, (max-width: 924px) 100vw, 924px\" \/><\/p>\n<p>Click &#8220;edit&#8221; for one of these rows and you will see the data inside. In the screenshot below, you can see the Tasks attached to the &#8220;Blog Posts&#8221; project. This data is seralized. WPEngine has <a href=\"https:\/\/wpengine.com\/support\/wordpress-serialized-data\/\">a useful introduction to serialized data<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full shadow wp-image-11494\" src=\"https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/post-meta-tasks.png\" alt=\"Tasks attached to project in the UpStream database\" width=\"649\" height=\"421\" srcset=\"https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/post-meta-tasks.png 649w, https:\/\/upstreamplugin.com\/wp-content\/uploads\/2018\/04\/post-meta-tasks-300x195.png 300w\" sizes=\"auto, (max-width: 649px) 100vw, 649px\" \/><\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":27,"template":"","format":"standard","class_list":["post-11489","knowledgebase","type-knowledgebase","status-publish","format-standard","hentry","knowledgebase_category-developers","entry","no-media"],"_links":{"self":[{"href":"https:\/\/upstreamplugin.com\/wp-json\/wp\/v2\/knowledgebase\/11489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/upstreamplugin.com\/wp-json\/wp\/v2\/knowledgebase"}],"about":[{"href":"https:\/\/upstreamplugin.com\/wp-json\/wp\/v2\/types\/knowledgebase"}],"author":[{"embeddable":true,"href":"https:\/\/upstreamplugin.com\/wp-json\/wp\/v2\/users\/1"}],"wp:attachment":[{"href":"https:\/\/upstreamplugin.com\/wp-json\/wp\/v2\/media?parent=11489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}