Support Questions
Find answers, ask questions, and share your expertise

How do I redirect the backup file created by the command "ambari-server backup" to any location I want rather default one of /var/lib/ambari-server/?

New Contributor

By default the backup file is created at /var/lib/ambari-server/ directory. I want it to go to any other location and the redirection operator of bash is not helping, nor is the help option of "ambari-server command" giving any hints.

Kindly note that am not looking PostGreSQL backup, which is the default backend of Ambari Server, but the entire Ambari Server as a whole, as is taken by the command "ambari-server backup" command.

3 REPLIES 3

Mentor

@Gautam Somani

Look at this backup process for postgress , its practically the same for MySQL only ,you will have to use mysql dump

New Contributor

Am looking for the entire ambari-server backup, not just the backend DB.

Super Mentor

@Gautam Somani

While running the "ambari-server backup" command if not path is specified then the following default PATH is choosen as per: https://github.com/apache/ambari/blob/release-2.6.1/ambari-server/src/main/python/ambari_server/Back...

# What to use when no path/archive is specified
DEFAULT_ARCHIVE = AmbariPath.get("/var/lib/ambari-server/Ambari_State_Backup.zip")

.


So if you want to specify a custom PATH for ambari server backup then you will have to supply the path as well in the command argument as following. In this case the Backup will be created in the mentioned path "/tmp/Ambari-Backup.zip"

# ambari-server backup /tmp/Ambari-Backup.zip

.

; ;