{"id":51,"date":"2017-07-07T19:34:14","date_gmt":"2017-07-07T19:34:14","guid":{"rendered":"http:\/\/www.iam8up.com\/?p=51"},"modified":"2017-07-07T19:34:14","modified_gmt":"2017-07-07T19:34:14","slug":"rrdtool-dump-and-restore","status":"publish","type":"post","link":"https:\/\/www.iam8up.com\/?p=51","title":{"rendered":"RRDTool dump and restore"},"content":{"rendered":"<p>This issue typically comes up when moving data from a 32bit to a 64bit system. \u00a0The commands are very easy to work with for one file, but with many files and multiple directories (subdirectories) it can be cumbersome. \u00a0I found this post in a forum and found it extremely useful and powerful.<\/p>\n<p>SRC:\u00a0http:\/\/www.linuxquestions.org\/questions\/programming-9\/script-to-dump-and-restore-rrd-files-608407\/<\/p>\n<p>This should be a foo.sh file and you should run it in \/usr\/share\/app\/data where the files are within data or below that. \u00a0It will convert and <strong>rename<\/strong> the file from rrd to xml. \u00a0Transfer the data over to the new system and run the same command (either no argument or look at the bottom for &#8216;help&#8217;).<\/p>\n<blockquote>\n<pre class=\"bbcodeblock\" dir=\"ltr\" style=\"color: #000000;\">#!\/bin\/sh\r\n\r\nECHO=\"echo -e\"\r\n\r\nrrdump ()\r\n{\r\n\tfor rrd in `find . -type f -name \"*.rrd\"`\r\n\t\tdo\r\n\t\t\txml=`echo $rrd | sed 's\/.rrd\/\/g'`\r\n\t\t\trrdtool dump $rrd &gt; $<span class=\"skimlinks-unlinked\">xml.xml<\/span>\r\n\t\t\trm $rrd\r\n\t\tdone\r\n}\t\r\n\r\nxmlimport ()\r\n{\r\n\tfor xml in `find . -type f -name \"*.xml\"`\r\n        do\r\n                rrd=`echo $xml | sed 's\/.xml\/\/g'`\r\n                rrdtool restore $xml $<span class=\"skimlinks-unlinked\">rrd.rrd<\/span>\r\n                rm $xml\r\n        done\r\n}\r\n\r\n\r\ncase \"$1\" in\r\n        dump)\r\n                rrdump\r\n\t\t;;\r\n        import)\r\n                xmlimport\r\n                ;;\r\n        *)\r\n                $ECHO \"$0 takes one of two arguments\\n\"\r\n\t\t$ECHO \"$0 dump -- dumps contents to xml\\n\"\r\n\t\t$ECHO \"$0 import -- imports xml files to rrd\\n\"\r\n                ;;\r\nesac<\/pre>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>This issue typically comes up when moving data from a 32bit to a 64bit system. \u00a0The commands are very easy to work with for one file, but with many files and multiple directories (subdirectories) it can be cumbersome. \u00a0I found this post in a forum and found it extremely useful and powerful. SRC:\u00a0http:\/\/www.linuxquestions.org\/questions\/programming-9\/script-to-dump-and-restore-rrd-files-608407\/ This should &hellip; <a href=\"https:\/\/www.iam8up.com\/?p=51\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;RRDTool dump and restore&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-51","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.iam8up.com\/index.php?rest_route=\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iam8up.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iam8up.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iam8up.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iam8up.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=51"}],"version-history":[{"count":1,"href":"https:\/\/www.iam8up.com\/index.php?rest_route=\/wp\/v2\/posts\/51\/revisions"}],"predecessor-version":[{"id":52,"href":"https:\/\/www.iam8up.com\/index.php?rest_route=\/wp\/v2\/posts\/51\/revisions\/52"}],"wp:attachment":[{"href":"https:\/\/www.iam8up.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iam8up.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iam8up.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}