• Mac OS X Server

    Export All Profile Manager Data Into CSV

    If you fire up a connection to Postgres on a Profile Manager server, you can see a list of all the databases and tables on the server, respectively: sudo -u _devicemgr psql -h /Library/Server/ProfileManager/Config/var/PostgreSQL devicemgr_v2m0 devicemgr_v2m0=# \list devicemgr_v2m0=# \dt The list of tables is as follows: Name | Owner | Encoding | Collate | Ctype | Access privileges ----------------+------------+----------+---------+-------+--------------------------- devicemgr_v2m0 | _devicemgr | UTF8 | C | C | postgres | _devicemgr | UTF8 | C | C | template0 | _devicemgr | UTF8 | C | C | =c/_devicemgr + | | | | | _devicemgr=CTc/_devicemgr template1 | _devicemgr | UTF8 | C | C | =c/_devicemgr + |…

  • SQL

    A Couple Of Ways To Backup SQL Data

    Create a backup copy of a table called Customers into a table called Customers2 on a running database called Backup: SELECT * INTO Customers2 IN 'Backup.mdb' FROM Customers; You can also specify multiple tables to pull data from when bringing that data into a new table, effectively merging data into a backup database: SELECT Customers.Site, IPs.IP INTO CustomerIPsbackup FROM Customers LEFT JOIN IPs ON Customers.Site=IPs.IP; Since this is more like replication than backup, MySQL also has a mysqldump command, used to dump a sql database to a file or screen, or whatever. Here, we’ll export all of our databases in a running MySQL instance into a file called dumpfile.sql: mysqldump…