{"id":14193,"date":"2015-11-02T10:00:08","date_gmt":"2015-11-02T09:00:08","guid":{"rendered":"http:\/\/nolabnoparty.com\/en\/?p=14193"},"modified":"2023-07-16T11:25:00","modified_gmt":"2023-07-16T09:25:00","slug":"vmware-vcsa-6-0-database-backup","status":"publish","type":"post","link":"https:\/\/nolabnoparty.com\/en\/vmware-vcsa-6-0-database-backup\/","title":{"rendered":"VMware VCSA 6.0 database backup"},"content":{"rendered":"<p><img decoding=\"async\" class=\"aligncenter wp-image-14166 size-full\" title=\"vcsa60dbbackup01\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/10\/vcsa60dbbackup01.jpg\" alt=\"vcsa60dbbackup01\" width=\"602\" height=\"202\" \/><\/p>\n<p>If the embedded vPostgres DB\u00a0is used in your vCenter appliance, you should perform the VCSA 6.0 database\u00a0backup on a regular basis to minimize the risk of data loss.<\/p>\n<p>Performing regular database\u00a0backups protect the data stored in the database because, in case of VCSA failure or replacement, without having a working DB backup, <strong>all data is lost<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<h2>Prerequisites<\/h2>\n<p>To backup and restore the embedded vPostgres database from your VCSA 6.0, you need two <strong>scripts provided by VMware<\/strong> you can download from the <a href=\"http:\/\/kb.vmware.com\/selfservice\/microsites\/search.do?language=en_US&amp;cmd=displayKC&amp;externalId=2091961\" target=\"_blank\" rel=\"noopener\">VMware KB<\/a>:<\/p>\n<ul>\n<li>backup_lin.py<\/li>\n<li>restore_lin.py<\/li>\n<\/ul>\n<p>In addition you need to create a folder in which you want to <strong>store the backup file<\/strong>\u00a0verifying you have read and write permissions.<\/p>\n<p>&nbsp;<\/p>\n<h2>Backup the vPostgres\u00a0database<\/h2>\n<p>Using a tool like PuTTY, <strong>SSH as root your VCSA appliance<\/strong> and <strong>Enable BASH access<\/strong> with the command:<\/p>\n<p><span style=\"color: #333399;\">Command&gt; shell.set --enabled True<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14167 size-full\" title=\"vcsa60dbbackup02\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/10\/vcsa60dbbackup02.jpg\" alt=\"vcsa60dbbackup02\" width=\"600\" height=\"277\" \/><\/p>\n<p>Launch <strong>BASH shell<\/strong>.<\/p>\n<p><span style=\"color: #333399;\">Command&gt; shell<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14168 size-full\" title=\"vcsa60dbbackup03\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/10\/vcsa60dbbackup03.jpg\" alt=\"vcsa60dbbackup03\" width=\"600\" height=\"284\" \/><\/p>\n<p>Create a <strong>folder backupdb<\/strong> in the appliance root.<\/p>\n<p><span style=\"color: #333399;\"># mkdir \/backupdb<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14169 size-full\" title=\"vcsa60dbbackup04\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/10\/vcsa60dbbackup04.jpg\" alt=\"vcsa60dbbackup04\" width=\"600\" height=\"160\" \/><\/p>\n<p>To copy the two script files to the VCSA you can use a tool like WinSCP. Since the default appliance shell <strong>cannot be the remote partner of WinSCP<\/strong>, you may receive an error message while trying to connect the VCSA with WinSCP.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14170 size-full\" title=\"vcsa60dbbackup05\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/10\/vcsa60dbbackup05.jpg\" alt=\"vcsa60dbbackup05\" width=\"486\" height=\"209\" \/><\/p>\n<p>To allow WinSCP to access the VCSA, you need to <strong>change the default shell to BASH<\/strong> running the following command (BASH shell must be enabled and active):<\/p>\n<p><span style=\"color: #333399;\"># chsh -s \/bin\/bash root<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14171 size-full\" title=\"vcsa60dbbackup07\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/10\/vcsa60dbbackup06.jpg\" alt=\"vcsa60dbbackup06\" width=\"600\" height=\"66\" \/><\/p>\n<p>Use WinSCP to <strong>copy the script files<\/strong> to <em>\/backupdb<\/em> folder.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14172 size-full\" title=\"vcsa60dbbackup07\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/10\/vcsa60dbbackup07.jpg\" alt=\"vcsa60dbbackup07\" width=\"570\" height=\"500\" \/><\/p>\n<p>Return to the <strong>appliance shell<\/strong>\u00a0running the command:<\/p>\n<p><span style=\"color: #333399;\"># chsh -s \/bin\/appliancesh root<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14173 size-full\" title=\"vcsa60dbbackup08\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/10\/vcsa60dbbackup08.jpg\" alt=\"vcsa60dbbackup08\" width=\"600\" height=\"68\" \/><\/p>\n<p>Make the <strong>scripts executable<\/strong> with the command:<\/p>\n<p><span style=\"color: #333399;\"># chmod 700 backup_lin.py <\/span><br \/>\n<span style=\"color: #333399;\"># chmod 700 restore_lin.py<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14174 size-full\" title=\"vcsa60dbbackup09\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/10\/vcsa60dbbackup09.jpg\" alt=\"vcsa60dbbackup09\" width=\"600\" height=\"126\" \/><\/p>\n<p>&nbsp;<\/p>\n<h4>Backup<\/h4>\n<p>Run the <em>backup_lin.py<\/em> script file specifying the <strong>target location<\/strong> and check the result.<\/p>\n<p><span style=\"color: #333399;\"># python \/backupdb\/backup_lin.py -f \/backupdb\/VCSA_backup.bak <\/span><br \/>\n<span style=\"color: #333399;\"># ls -l<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14175 size-full\" title=\"vcsa60dbbackup10\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/10\/vcsa60dbbackup10.jpg\" alt=\"vcsa60dbbackup10\" width=\"600\" height=\"127\" \/><\/p>\n<p>To store the backup in a safe place, you can use WinSCP to<strong> copy the backup file<\/strong> to your preferred storage.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14200 size-full\" title=\"vcsa60dbbackup11\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/11\/vcsa60dbbackup11-e1446103620267.jpg\" alt=\"vcsa60dbbackup11\" width=\"600\" height=\"527\" \/><\/p>\n<p>&nbsp;<\/p>\n<h4>Restore<\/h4>\n<p>Before restoring the VCSA DB, you need to <strong>stop the vmware-vpxd and vmware-vdcs services<\/strong>.<\/p>\n<p><span style=\"color: #333399;\"># service vmware-vpxd stop<\/span><br \/>\n<span style=\"color: #333399;\"> # service vmware-vdcs stop<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14201 size-full\" title=\"vcsa60dbbackup12\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/11\/vcsa60dbbackup12-e1446103749995.jpg\" alt=\"vcsa60dbbackup12\" width=\"600\" height=\"113\" \/><\/p>\n<p>Run the <em>restore_lin.py<\/em> script file specifying the <strong>backup location<\/strong>.<\/p>\n<p><span style=\"color: #333399;\"># python \/backupdb\/restore_lin.py -f \/backupdb\/VCSA_backup.bak<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14202 size-full\" title=\"vcsa60dbbackup13\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/11\/vcsa60dbbackup13-e1446103820444.jpg\" alt=\"vcsa60dbbackup13\" width=\"600\" height=\"158\" \/><\/p>\n<p>When the restore process completes successfully, <strong>start the services<\/strong>\u00a0previously stopped.<\/p>\n<p><span style=\"color: #333399;\"># service vmware-vpxd start<\/span><br \/>\n<span style=\"color: #333399;\"> # service vmware-vdcs start<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-14203 size-full\" title=\"vcsa60dbbackup14\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/2015\/11\/vcsa60dbbackup14-e1446103851898.jpg\" alt=\"vcsa60dbbackup14\" width=\"600\" height=\"311\" \/><\/p>\n<p>To keep the highest level of security and avoid data loss, you should backup the database on a <strong>daily basis<\/strong>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/nolabnoparty.com\/wp-content\/uploads\/images\/firma.jpg\" alt=\"firma\" title=\"\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If the embedded vPostgres DB\u00a0is used in your vCenter appliance, you should perform the VCSA 6.0 database\u00a0backup on a regular basis to minimize the risk of data loss. Performing regular database\u00a0backups protect the data stored in the database because, in case of VCSA failure or replacement, without having a working DB backup, all data is lost. &nbsp; Prerequisites To backup and restore the embedded vPostgres database from your VCSA 6.0, you need two scripts provided by VMware you can download from the VMware KB: backup_lin.py restore_lin.py In addition you need to create a folder in which you want to store <\/p>\n","protected":false},"author":3,"featured_media":14166,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rop_custom_images_group":[],"rop_custom_messages_group":[],"rop_publish_now":"initial","rop_publish_now_accounts":{"linkedin_93tdZWzMZc_93tdZWzMZc":"","facebook_2879994398731222_17841400390232720":"","twitter_113568041_113568041":"","mastodon_115463926174894442_115463926174894442":""},"rop_publish_now_history":[],"rop_publish_now_status":"pending","footnotes":""},"categories":[903,2701],"tags":[579,695,1551,699],"class_list":["post-14193","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vmware-en","category-vsphere-en","tag-backup-en","tag-database-en","tag-vcsa","tag-vmware-en","has_thumb"],"_links":{"self":[{"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/posts\/14193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/comments?post=14193"}],"version-history":[{"count":0,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/posts\/14193\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/media\/14166"}],"wp:attachment":[{"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/media?parent=14193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/categories?post=14193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nolabnoparty.com\/en\/wp-json\/wp\/v2\/tags?post=14193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}