ESX Virtualization

VMware ESXi, vSphere, VMware Backup, Hyper-V... how-to, videos....

Nakivo Backup and Replication - #1 Backup solution for Virtual, physical, cloud, NAS and SaaS

Menu
  • Certification
      • VCP-DCV vSphere 8
          • vcp2024-125.
        • Close
    • Close
  • VMware
    • Configuration Maximums
    • vSphere
      • vSphere 8.0
      • vSphere 7.0
      • vSphere 6.7
      • vSphere 6.5
      • vSphere 6.0
      • Close
    • VMworld
      • VMware EXPLORE 2024
      • VMware EXPLORE 2023
      • VMware EXPLORE 2022
      • VMworld 2019
      • VMworld 2018
      • VMworld 2017
      • VMworld 2016
      • VMworld 2015
      • VMworld 2014
      • VMworld 2013
      • VMworld 2012
      • VMworld 2011
      • Close
    • Close
  • Microsoft
    • Windows Server 2012
    • Windows Server 2016
    • Windows Server 2019
    • Close
  • Categories
    • Tips – VMware, Microsoft and General IT tips and definitions, What is this?, How this works?
    • Server Virtualization – VMware ESXi, ESXi Free Hypervizor, VMware vSphere Server Virtualization, VMware Cloud and Datacenter Virtualization
    • Backup – Virtualization Backup Solutions, VMware vSphere Backup and ESXi backup solutions.
    • Desktop Virtualization – Desktop Virtualization, VMware Workstation, VMware Fusion, VMware Horizon View, tips and tutorials
    • How To – ESXi Tutorials, IT and virtualization tutorials, VMware ESXi 4.x, ESXi 5.x and VMware vSphere. VMware Workstation and other IT tutorials.
    • Free – Free virtualization utilities, ESXi Free, Monitoring and free backup utilities for ESXi and Hyper-V. Free IT tools.
    • Videos – VMware Virtualization Videos, VMware ESXi Videos, ESXi 4.x, ESXi 5.x tips and videos.
    • Home Lab
    • Reviews – Virtualization Software and reviews, Disaster and backup recovery software reviews. Virtual infrastructure monitoring software review.
    • Close
  • Partners
    • NAKIVO
    • StarWind
    • Zerto
    • Xorux
    • Close
  • This Web
    • News
    • ESXi Lab
    • About
    • Advertise
    • Archives
    • Disclaimer
    • PDFs and Books
    • Close
  • Free
  • Privacy policy

How to backup and restore vPostgres database on VCSA 6

By Vladan SEGET | Last Updated: January 11, 2019

Shares

After the release of VMware vSphere 6, the vCenter Server Appliance 6 (Linux) has a possibility to run vPostgres internal DB. The VCSA with vPostgress DB can support up to up to 1000 hosts and 10,000 VMs using the embedded database. If you running vCenter server 6 appliance (VCSA) the built in vPostgres database can be backed up separately. VMware provides a Python based scripts which allows to backup and restore the built-in DB.

I have tested their solution in my lab. You can use this tutorial to test it as well. You don't have to have much Linux skills. Me too I'm rather Windows guy, but few Linux commands is a must those days… 🙂 I used two tools for the job – Putty and WinSCP. I guess the wast majority of IT admins know those tools and how to use them. Both are listed on my Free Tools page as well. In fact I just followed a VMware KB as a reference. You'll find the link inside the tutorial (you'll need to download the Python scripts) and also below the post. This post is for everyone who want to test backup and restore vPostgres database on VCSA 6.

In case you're still running on VCSA 5.5, you might want to check how my lab upgrade was – How to Upgrade from VCSA 5.5 to 6.0 – Lab Time.

How to backup and restore vPostgres database on VCSA 6 – The steps:

Step 0: Download this script from VMware KB (you'll find it attached at the bottom) > unzip the content (you'll get 2 files backup_lin.py and restore_lin.py)

Step 1. login as a root via SSH client and copy the two files to a /tmp folder on the appliance.

Step 2. Make the backup_lin.py executable with this command

chmod 700 /tmp/backup_lin.py

like this:

How to backup vPostgres database VCSA 6

Step 3: run the backup_lin.py command to backup the db

python /tmp/backup_lin.py -f /tmp/backup_VCDB_vladan.bak

Result…
How to backup vPostgres DB on VCSA 6

Then check the directory with ls -l to see the details on size etc…

How to backup vPostgres DB on VCSA 6

If you want you can copy that file outside of the VCSA to have it on different location as well… Below screenshot showing WinSCP used for this…

How to backup vPostgres DB on VCSA 6

How to restore?

Step 1: The restore operation is similar, but before we do a restore we need to stop some VMware services…

service vmware-vpxd stop

service vmware-vdcs stop

How to backup vPostgres DB on VCSA 6

Step 2: run this command to restore:

restore_lin.py -f /tmp/backup_VCDB_vladan.bak

or whichever name you gave it…

You should see

Restore completed successfully message

How to backup vPostgres DB on VCSA 6

The Original VMware KB is here. Check it out!

While the wast majority of the backup products out there is not for the moment compatible with vSphere 6 you might use this method to backup your DB “just-in-case”…. But those products shall be compatible quite soon. Veeam announced the compatibility of vSphere 6 in a reasonable time as they're working towards complete compatibility with vSphere 6 including VVOLs.

One product should't have problem with backing up VCSA however – vSphere Data Protection 6 which has been released at the same time that vSphere 6. I haven't tested VDP 6 just yet, but it's on my To-do list… Subscribe to my RSS or follow via Twitter or FB. In case you did not know, the blog has daily updates. That's why it's been listed as N 13 most popular Virtualization Blog … -:) Stay tuned for more !!

Shares
5/5 - (1 vote)

| Filed Under: How To Tagged With: How to backup and restore vPostgres database on VCSA 6

About Vladan SEGET

This website is maintained by Vladan SEGET. Vladan is as an Independent consultant, professional blogger, vExpert x16, Veeam Vanguard x9, VCAP-DCA/DCD, ESX Virtualization site has started as a simple bookmarking site, but quickly found a large following of readers and subscribers.

Connect on: Facebook. Feel free to network via Twitter @vladan.

Comments

  1. John says

    June 15, 2015 at 10:16 pm

    postgresql – vCSA 5.5 vPostgres backup routine – Stack …

  2. John Nicholson says

    June 30, 2015 at 12:56 am

    Hi Vladin,
    Thanks for the tips on this backup utility. I was looking for a way to back up the Postgres DB in the new Vcenter 6 appliance and I ran across your blog. One thing I found out was that the /tmp directory in the appliance is truly temporary. I set up a cron job last Friday to dump my backups from the python script to /tmp/bu and came in Monday to find the bu directory was gone! No big deal, I am going to tweak my cron job and move the location of the python dumps to a directory I created called /bak and hopefully this directory wont be auto purged.Thanks again for the tips on the backup of the appliance.
    John

  3. Brian says

    July 15, 2015 at 12:36 am

    Great article. Is there a script for vCSA 5.5?

    • Vladan SEGET says

      July 16, 2015 at 8:04 am

      Yes, check this. http://www.vladan.fr/backup-restore-vcsa-5-5-internal-database/

  4. David says

    November 21, 2015 at 12:35 am

    Now if we could only get it to save the DB to a NFS it would be great!

  5. Andrei says

    June 9, 2016 at 6:01 pm

    Hi,

    Any way to use Veeam to backup the whole VCSA without using this method? Of course, with the DB in a consistent state?

    Thanks,
    Andrei

    • Vladan SEGET says

      June 10, 2016 at 6:21 am

      Ofcourse! Veeam can back Full VM without problem. This post is not a solution for a “normal” people….

  6. Ahmed123 says

    March 7, 2017 at 4:03 pm

    Hi Vladan,
    Can I backup the PostgreSQL from vCenter 6.0 and restore in MS SQL 2014?
    Basically, want to migrate the Database from PostgreSQL to SQL 2014 , while maintaining the same vCenter server v6.0 u2

    Regards
    Ahmed

    • Vladan SEGET says

      March 7, 2017 at 4:13 pm

      Hi Ahmed,

      If I were you, I’d check with your VMware support if this is supported scenario. But it’s a good question.

Private Sponsors

Featured

  • Thinking about HCI? G2, an independent tech solutions peer review platform, has published its Winter 2023 Reports on Hyperconverged Infrastructure (HCI) Solutions.
  • Zerto: One Platform for Disaster Recovery, Backup & Cloud Mobility: Try FREE Hands-On Labs Today!
Click to Become a Sponsor

Most Recent

  • Commvault’s Innovations at RSA Conference 2025 San Francisco
  • VMware ESXi FREE is FREE again!
  • Installation of StarWind VSAN Plugin for vSphere
  • Protect Mixed environments with Nakivo Physical Machine recovery (bare metal)
  • No more FREE licenses of VMware vSphere for vExperts – What’s your options?
  • Tails – Your Private OS on USB Stick
  • StarWind V2V Converter Now has CLI
  • Veeam VHR ISO v2 – 2025 Download and Install
  • Deployment OVA and Installation of Nakivo Backup and Replication for VMware
  • XCP-NG FREE Hypervisor and XO Lite to deploy XOA

Get new posts by email:

 

 

 

 

Support us on Ko-Fi

 

 

Buy Me a Coffee at ko-fi.com

Sponsors

Free Trials

  • DC Scope for VMware vSphere – optimization, capacity planning, and cost management. Download FREE Trial Here.
  • Augmented Inline Deduplication, Altaro VM Backup v9 For #VMware and #Hyper-V – Grab your copy now download TRIAL.

VMware Engineer Jobs

VMware Engineer Jobs

YouTube

…

Find us on Facebook

ESX Virtualization

…

Copyright © 2025 ·Dynamik-Gen · Genesis Framework · Log in