{"id":452,"date":"2013-07-16T06:55:00","date_gmt":"2013-07-16T06:55:00","guid":{"rendered":"https:\/\/opstree.com\/blog\/\/2013\/07\/16\/automated-db-updater-release-first-release\/"},"modified":"2019-09-18T15:24:35","modified_gmt":"2019-09-18T09:54:35","slug":"automated-db-updater-release-first-release","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2013\/07\/16\/automated-db-updater-release-first-release\/","title":{"rendered":"Automated DB Updater Release First Release"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align:left;\">\n<div dir=\"ltr\" style=\"text-align:left;\">Initial version of Automated DB Updater Release ADU<\/p>\n<p>With this blog I&#8217;m releasing the intial version of a python utility to provide automated db updates across various environments for different components.<\/p>\n<p>The code for this utility is hosted on github<br \/>\nhttps:\/\/github.com\/sandy724\/ADU<\/p>\n<p>You can clone the read only copy of this codebase by url given below<br \/>\nhttps:\/\/github.com\/sandy724\/ADU.git<\/p>\n<p>To understand the basic idea about this utility go thorugh this blog<br \/>\nhttp:\/\/sandy4blogs.blogspot.in\/2013\/07\/automated-db-updater.html<\/p>\n<p>How to use this utility<br \/>\nCheckout the code at some directory, add the path of this directory in PYTHONPATH environment variable<br \/>\nCreate a database with a script&#8217;s metadata table with given below ddl<\/p>\n<p><i>CREATE TABLE `script_metadata` (<\/i><br \/>\n<i>&nbsp; `name` varchar(100) DEFAULT NOT NULL,<\/i><br \/>\n<i>&nbsp; `version` int(11) DEFAULT NOT NULL,<\/i><br \/>\n<i>&nbsp; `executed` tinyint(1) NOT NULL DEFAULT &#8216;0&#8217;,<\/i><br \/>\n<i>&nbsp; `env` varchar(30) DEFAULT NOT NULL,<\/i><br \/>\n<i>&nbsp; `releas` varchar(30) DEFAULT NOT NULL,<\/i><br \/>\n<i>&nbsp; `component` varchar(30) DEFAULT NOT NULL<\/i><br \/>\n<i>)<\/i><br \/>\nCreate a database.properties, containing connection properties of each environment database<\/p>\n<div style=\"text-align:left;\"><i>[common_db]<\/i><\/div>\n<div style=\"text-align:left;\"><i>dbHost=localhost<\/i><\/div>\n<div style=\"text-align:left;\"><i>dbPort=3306<\/i><\/div>\n<div style=\"text-align:left;\"><i>dbUser=root<\/i><\/div>\n<div style=\"text-align:left;\"><i>dbPwd=root<\/i><\/div>\n<div style=\"text-align:left;\"><i>db=test<\/i><\/div>\n<div style=\"text-align:left;\"><i>&nbsp;<\/i><\/div>\n<div style=\"text-align:left;\"><i>&nbsp;<\/i><\/div>\n<div style=\"text-align:left;\"><i>[env1]<\/i><\/div>\n<div style=\"text-align:left;\"><i>dbHost=localhost<\/i><\/div>\n<div style=\"text-align:left;\"><i>dbPort=3306<\/i><\/div>\n<div style=\"text-align:left;\"><i>dbUser=root<\/i><\/div>\n<div style=\"text-align:left;\"><i>dbPwd=root<\/i><\/div>\n<div style=\"text-align:left;\"><i>db=test<\/i><\/div>\n<\/div>\n<\/div>\n<div style=\"text-align:left;\"><\/div>\n<div><\/div>\n<div dir=\"ltr\" style=\"text-align:left;\">\n<p>Here common_db represents connection to database which will contain metadata of scripts for monitoring<\/p>\n<p>Now execute the pythong utility<br \/>\nCopy the client(updateDB.py) to directory of your choice, make sure that property configration file should also be at this directory<br \/>\npython updateDB.py -f -r &#8211;env<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Initial version of Automated DB Updater Release ADU With this blog I&#8217;m releasing the intial version of a python utility to provide automated db updates across various environments for different components. The code for this utility is hosted on github https:\/\/github.com\/sandy724\/ADU You can clone the read only copy of this codebase by url given below &hellip; <a href=\"https:\/\/opstree.com\/blog\/2013\/07\/16\/automated-db-updater-release-first-release\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Automated DB Updater Release First Release&#8221;<\/span><\/a><\/p>\n","protected":false},"author":171775670,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[28070474],"tags":[44070,30871489,475,454883226,832],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-7i","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/452"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/171775670"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=452"}],"version-history":[{"count":5,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/452\/revisions"}],"predecessor-version":[{"id":1115,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/452\/revisions\/1115"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}