Command Line Equivalents
-
What are the command line equivalents to the web interface options to export hosts, export images and configuration save?
-
If you want to export just a table, examples of it can be found online.
-
Export for CSV format (export hosts, images, snapins, users, etc…) is purely done in php. It’s also handled by multiple files (one to prep the environment, the other to actually hand over the file once completed. This is not something that is simply “here’s what to do”. I recommend sticking with the GUI to get those files.
For Configuration save, all it does is a fog database dump to sql file. You can use any normal mechanism for that.
-
Bummer. I was hoping there might be a `manual’ option, script or what have you in the case a server goes down in such a way that re/building or accessing the web interface was impossible, and continued to fail.
-
mysqldump -p – –user=username dbname tableName > tableName.sql
Source:
https://steveswanson.wordpress.com/2009/04/21/exporting-and-importing-an-individual-mysql-table/ -
Thank you Wayne, but I’m wasn’t looking for A solution, I was looking for THE solution to explicitly, and exactly mimic each of the three options that are available from the Web Interface, export Hosts, export Images and Configuration save, so that they can be imported via the web interface, or command line of a working system, without any massaging.
The reason I brought it up was because I had a brand new system experience a hardware failure in such a way that the system could still boot, but apache was fubared. Attempts to correct this ran into further hdd failures. It was new so I didn’t care about losing what little information was there, but I wondered aloud if this was at all possible.
-
I don’t see how exporting and importing a table or DB isn’t good enough. It does exactly the same thing in the end.
-
using the method wayne posted would give you the complete database, including the hosts and image info. if you didn’t want to do a complete database restore, you could pull the data you wanted from it anyway.