Category: MacOS Q&A

[Q&A]How to backup/restore MacOS Server.app / Wiki

reference
bender

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#######################################################
Please note that this does NOT bring over any users or groups.  You need to restore OD for your Open Directory users to log in properly.
 
On the Target Server
1.	Setup new Target Server with IP domain name etc.
2.	Start the wiki service - log in and check that it is running properly.
3.	Turn off the Wiki Service on your Target Server, and quit out of Server.app
 
 
On Source Server
1.	Copy the FileData from your source server to your target server
	a.	Copy FileData from your latest Bender Backup.
	b.	Copy directly from /Library/Server/Wiki/FileData
 
2.	Perform a dump of your collab database:
	a.	Copy the collab.pgdump /Backups folder if using Bender
	b.	Manually perform the pg dump:
		pg_dump -h "/Library/Server/Wiki/PostgresSocket" --format=c --compress=9 --blobs --username=collab --file=/tmp/collab.pgdump collab
 
	**Note you can and should change the destination of the pgdump.**
 
On the Target Server
1.	Copy the FileData to the target system.
	/Library/Server/Wiki/FileData
 
2.	Set owners and permissions on the target.
	sudo chown -R _teamsserver:_teamsserver /Library/Server/Wiki/FileData
	sudo chmod -R +a "www allow search" /Library/Server/Wiki/FileData
 
3.	Prepare the Target for the pgdump.
	Connect to the psql service for the Wiki Service.  This will be done from within psql, so your prompt will change.
 
	sudo psql -h "/Library/Server/Wiki/PostgresSocket" -U collab template1
 
	Clear out PID so we can drop the database:
 
	SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'collab' AND pid <> pg_backend_pid();
 
	Drop the existing collab database:
 
	drop database "collab";
 
	Create a new collab database:
 
	create database "collab";
 
	Quit out of psql:
 
	\q
 
4.	Restore the Wiki by loading the pgdump from the Source Server:
	1.	Enable Wiki Service in Server.app
	2.	sudo pg_restore -h "/Library/Server/Wiki/PostgresSocket" -d collab -U collab --single-transaction "/Path/to/location/of/collab.pgdump"
 
5.	Clean up wiki permissions, searchindex and quicklooks.
	sudo wikiadmin fixPermissions
	sudo wikiadmin rebuildSearchIndex
	sudo wikiadmin resetQuicklooks
 
6.	Log in to your wiki's on the Target Server.
 
#######################################################
Tags : ,

[QA] How to free “inactive” memory in macos

In Terminal, run the fellowing command

purge

[QA] How to change fan speed in Mac programmatically

install smcFanControl

sudo ./smc -k F0Mx -w 2710
(0 = number zero, not o)
3e80 = 4000rpm
3680 = 3500rpm
2EE0 = 3000rpm
2710 = 2500rpm
1F40 = 2000rpm

Tags :

[QA] How to list all users and groups in macos

$ dscl . list /users
$ dscl . list /groups
$ dscl . readall /users
$ dscl . readall /groups
$ dscl -plist . readall /users
$ dscl -plist . readall /groups
Tags :

[QA] How to install svn in mac os 10.8.2

1. download from xCode

2. login to https://developer.apple.com/downloads/index.action and download Command Line Tools

Tags : ,