http://discussions.info.apple.com/WebX?50@54.RqDXaQB1tWH.26@.599b3b48 As long as you have to backup stuff, you really should make a clone of your entire 10.2.8 installation (use Carbon Copy Cloner, latest version.) Instead of doing an Erase and Install, use Disk Utility from the Panther Installer Disk 1 and run Repair Disk on your existing hard drive. If the drive is reported as OK and any errors are fixed, then proceed to install Panther using the Upgrade option. This will save you a lot of time and effort trying to restore items out of your Home folder. ********** Topic: Advice needed to move accounts to new machine Original Message ( Posted Jul 17, 03 1:49 pm ) Bruce Beighley Joined: Aug, 2002 Posts: 19 I need some pointers on how I go about moving existing user accounts, from one server to another. Both of these servers are running OS X Server, 10.2.6. One is a B&W G3, the other is a new Dual G4. There are some instructions on importing in the admin guide, It seems like it might work, although the instructions are somewhat convoluted. I have learned that if you select "export" on the server where the accounts are now, you get a message which reads, "Export replaces user passwords with default passwords. You can edit the export file to provide individual passwords. To preserve user passwords, backup and restore user accounts, instead of using export." Seems this would be a workable thing to do. Where is the file which contains the user accounts? Sorry, But I am new to the server version of the OS. Any tips or information would be helpful, Thanks. RE: Advice needed to move accounts to new machine ( msg # 1.: Posted Jul 17, 03 5:33 pm ) Putto Joined: Jul, 2003 Posts: 7 If you go into Netinfo Manager you can export (Go to management window then select save backup) netinfo accounts then reimport them. If you are using Netinfo "Netinfo" holds all the info about user accounts. Passenger would probly be the least painfull way of doing it but it costs $. Go to versiontracker.com to download it. ******************* Topic: Backing up Netinfo database Original Message ( Posted Mar 28, 03 12:19 pm ) Richard Saunders1 Joined: Mar, 2003 Posts: 13 What is the easiest/quickest way to backup the Netinfo database on a regular basis? Rick Saunders IT Manager/Pediatric Oncology Branch Saunders@mail.nih.gov Messages 2 - 3 of 3 ÊÊ View as Outline Ê|ÊPreviousÊ|ÊView All RE: Backing up Netinfo database ( msg # 1.1: Posted Mar 31, 03 8:36 am ) Richard Saunders1 Joined: Mar, 2003 Posts: 13 That folder is locked... Also I wanted to be able to back it up off of the server. Thanks RE: Backing up Netinfo database ( msg # 1.1.1: Posted Mar 31, 03 9:46 pm ) Stephen Ogletree Level 3 Joined: Aug, 2000 Posts: 711 You need to go command line and open up a root shell. sudo -s The directory is owned by root. The backup is a raw dump of netinfo. to restore from that backup, you'd need to use the command line tools; niload If you didn't want to backup just the raw data, you could always make a simple script that did a cp -R /var/db/netinfo command to back things up to say a netinfo.backup directory. Then to restore things it would be as simple as just replacing the netinfo directory with the copy of the backup without having to use niload. Either way, you're going to have to be using both the command line and a privilege user account that can su or sudo to a root shell. ************* Topic: Move users from local to network .... Original Message ( Posted Mar 19, 03 9:23 am ) Patrick Savelberg Level 1 Joined: Nov, 2002 Posts: 34 Hi, All my users are in the local list on the server, now i want to move them to the network list zo they can login with the home folder on th server, but how do i move them ..... is export import the only way ..... RE: Move users from local to network .... ( msg # 1.: Posted Mar 23, 03 3:17 am ) Simon Heimlicher Joined: Mar, 2003 Posts: 11 Hi, I guess, you're using NetInfo as directory for your user accounts? If so, you might export all your user accounts into a text file using "nidump" in "raw" format (option: "-r"). Then remove all records _except_ the ones you want in your network domain from this text file. (The format is quite easy to understand, but be careful since every single semicolon matters). Finally, you would import the text file into your network NetInfo database using "niload", again in "raw" mode ("-r"). Caution: The NetInfo utilities mentioned might destroy your whole NetInfo database at once. As a consequence, the Terminal will no longer call you "root@server" but "who am i@server" and all kinds of other bad things may happen. It's no fun, believe me. So make sure you - have a complete backup of your server and know how to restore it and be sure that it will actually work(!!). - read the man pages carefully - very very carefully reread every command before you press enter - always make sure you're working with the right domain in the correct directory. If you "niload" the contents of your "/users" tree into the "/" tree, everything else will be gone forever. But once you're comfortable with these utilities, they can save you a lot of clicking. Good luck! simon ************** Steps for upgrading to Panther with the least problems: 1. If you have an external FW800 hard disk, check for firmware updates and apply them (e.g. LaCie: http://www.lacie.com/support/drivers ). 2. Use one of the many utilities available to clean caches and run maintenance scripts. Utilities like MacJanitor, Jaguar Cache Cleaner, Cocktail, Onyx, etc. can be used (all available at versiontracker.com.) 3. Boot from your Jaguar or Panther Installer Disk 1. After the installer loads select Disk Utility from the Installer menu. After DU loads select your OS X volume, click on First Aid tab, click on Repair Disk. If Repair Disk reports any errors that it cannot fix, you will need to use Drive 10 or Disk Warrior to repair the drive. Do not proceed until you have completely repaired the drive. If DU reports the drive is OK quit DU and the installer and restart. If you own Disk Warrior, it is a good idea to repair the drive/volume with it even though Disk Utility reports the drive is OK. 4. Create a bootable backup of your hard disk to another drive/partition or an external drive using Carbon Copy Cloner (versiontracker.com.) 5. Update any haxies (e.g. ASM, TinkerTool) or third-party preference panes, startupitems, and login items or disable/remove them. Also disable/remove any utilities that install in the menubar. 6. Deactivate StuffIt AVR (StuffItDeluxe only), anti-virus programs, and other background programs. 7. Disable/remove all Norton Utilities/Systemworks files. 8. Power off any external firewire drives. Do not use a FW800 drive with Panther until you have installed a firmware update for it and updated Panther to 10.3.1. 9. Unplug all other peripherals except your mouse and keyboard. 10. Startup from the Panther Installer Disk 1 and proceed to install Panther. Use the Upgrade option. 11. After restart load Disk Utility and repair permissions. The above steps should also be followed for an Archie and Install except that in Item 10 you would choose the Archive and Install option instead of the Upgrade option. **************** RE: How to restore Home Directory on New HD? ( msg # 1.: Posted Nov 21, 03 11:36 pm ) Scott Radloff Level 2 Joined: Sep, 2003 Posts: 853 Hello James, This is easier than you think. -First, you will create a new admin user with the exact same username and user short name that you had before. If the current admin user account is set up this way, fine. -Next, you will need to enablethe root account, then log in as root. When logged in as root, you will move whichever current admin user folder that has the same name as your original to the trash, then replace it with your old admin user folder. Once this is done, you will open Terminal and run the chown command on the "moved" folder, to give your current admin user ownership of the folder. -Finally, you will log out of the root account, log in as your "old" self, and disable the root account. All of these steps are very explicitly outlined in the sections on manualbackups and restores in this article: http://docs.info.apple.com/article.html?artnum=106941 Please PRINT this article and then use it to restore your old user data. It should take about 5 minutes, start to finish ;-) I hope this helps :) Scott Topic: Keep user in home directory with ssh and sftp Original Message ( Posted Dec 5, 03 1:42 pm ) Justin Fagnani-Bell Joined: Nov, 2003 Posts: 8 I'm setting up a client FTP area on our XServe and ouwld like to limit clients so they can only see thier home directory. Everything works fine for FTP when I make the setting in Workgroup Manager, but if you login with SFTP you can access the whole disc. The problem is that if I turn off shell access so that SFTP is disabled then you can't FTP into the machine. Any suggestions? I'm not a pro admin, but I've setup Linux to chroot FTP and SFTP logins. I'd like to do this the "Mac" way though. Topic: How do I remotely create home Directories? Original Message ( Posted Oct 9, 03 9:29 am ) Jason Badham Level 1 Joined: Jul, 2002 Posts: 43 I am trying to create folders and asign privleges to them, but I don't want all of the "usual" folders (Desktop, Music, Movies etc.) to be shown, I just want the user I set up to have access to one folder. Anyone know how I can do this? Any help is greatly appreciated! Thanks in advance! PowerMac G4 Dual 1.25 MDD; Mac OS X (10.2.x); 768 RAM RE: How do I remotely create home Directories? ( msg # 1.: Posted Oct 27, 03 5:19 pm ) dmartens Level 1 Joined: Posts: 37 I believe John D's tips and tricks describe how to change the default home directory folder structures. You can down load these at: http://homepage.mac.com/johnd/album.html Creating the home directories remotely is quite simple. Once your users are created & they all have the correct settings in the home directory area of WorkGroup Manager, ssh into your server, su root and run the command line utility CreateHomeDir. This will automatically search through the NetInfo path & create any missing home directories. You might run a man createhomedir first to see any paramaters that can be specified. RE: dsimportexport not found ( msg # 1.: Posted Oct 9, 02 1:50 pm ) jrh01 Joined: May, 2001 Posts: 3 The information below is to be used at your own risk. However, it did allow me to migrate a local domain to a /Netinfo/root/$server domain without much work. 1. Export a current user using Workgroup Manager on the new machine. This file will contain the necessary header information for importing new records. Save this record as "template.txt" to your desktop. 2. On the machine with the exising local domain records, dump the password and groups databases. This dump will include user encrypted passwords. nidump passwd . > file.users nidump group . > file.groups 3. Move those two files over to the new machine. 4. Copy and paste the header info from the "template.txt" file into file.users on a single line. You may have to modify the order and dsAttrTypeStandard contents to match the exact content of your nidump. See Appendix A in the 10.2 Server Admin Guide for more information. 0x0A 0x5C 0x3A 0x2C dsRecTypeStandard:Users 13 dsAttrTypeStandard:RecordName dsAttrTypeStandard:Password dsAttrTypeStandard:UniqueID dsAttrTypeStandard:PrimaryGroupID dsAttrTypeStandard:Comment dsAttrTypeStandard:Expire dsAttrTypeStandard:Change dsAttrTypeStandard:RealName dsAttrTypeStandard:NFSHomeDirectory dsAttrTypeStandard:UserShell dsAttrTypeStandard:PrintServiceInfoXML dsAttrTypeStandard:HomeDirectory dsAttrTypeStandard:MailAttribute 5. Remove any system and "real" users that already exist on the new machine from file.users for safety's sake. 6. Import the modified file.users document using Workgroup Manager into the proper domain on the new machine. Use the "Use record description in file" setting and handle duplicates as necessary. 7. Import the file.groups document using Workgroup Manager into the proper domain on the new machine. Use the "Standard groups file" setting and handle duplicates as necessary. Topic: backing up MySQL databases under OS X. Original Message ( Posted Apr 25, 03 5:03 pm ) Mark Strom Level 2 Joined: Aug, 2000 Posts: 126 I'm running a bulletin board using phpbb, php, and MySQL (3.23.53) on a Mac OS X Server (10.2.5). For several months after starting the board I backed up the database using Synchronize Pro X from a remote computer. Everything was fine until recently when it appears something happened during the backup and the active MySQL databases were deleted. I have since restored the server using a backup of the database and everything is working well except the backing up part. When I try to backup the database directory from one drive on an XServe to another using the new version of Synchronize Pro X 2.1.1, immediately after the backup the speed at which pages are served from the forums slows to a crawl--if they are served at all. I've found that if I then access MySQL databases using PHPMyAdmin and run the optimization routine on all tables, the site speed is restored. From this I'm assuming that the backup of an open database is causing a problem. Can someone give me an idea for a solution that will safely backup a MySQL database automatically and at a scheduled time? Assume that while I can follow and implement commands through terminal, my unix skills are rudimentary at best! Thanks for any help, -Mark XServe; Mac OS X (10.2.x); 2 installed drives Messages 1 - 3 of 3 ÊÊ View as Outline RE: backing up MySQL databases under OS X. ( msg # 1.: Posted May 10, 03 6:59 am ) Iain Donaldson Joined: Mar, 2003 Posts: 16 Mark: Best thing to do is run a cron job with mysqldump at regular intervals. I do it once a day to a specific file and then back that file up off the server using Retrospect so I have an daily increment. Some databases you might want to backup more regularly in which case you may want to write a script to cycle through a number of files so you can rollback to more than just the last backup in case of dire emergency. You can backup a database with the command: /usr/bin/mysqldump -u -p > (assuming you're using the original Apple mysql installation. If not, your mysql dump will probably be in /usr/local/mysql/bin/mysqldump) so, for example, if you had a database called 'things', an SQL user called 'admin' and password 'le7hz' and wanted to backup the database in a file located '/backups/sql/things.db.sql', you'd use the command: /usr/bin/mysqldump -uadmin -ple7hz things > /backups/sql/things.db.sql You can then add this as a cron task (see 'man crontab' for instructions on how to set up the task once you have a cron table file andhttp://www.omc.net/cgi-bin/man.cgi?section=5&topic=crontab for how to set up a file). ..Iain RE: backing up MySQL databases under OS X. ( msg # 1.1: Posted May 12, 03 9:50 am ) Mark Strom Level 2 Joined: Aug, 2000 Posts: 126 Hi Iain Thank you very much! I knew that mysqldump was probably the way to go, but I was having a little trouble with the correct syntax. I now have it working, and was able to set it up as a cron task that is running it at a regular interval (although I "cheated" a bit and used a freeware app called CronniX to write the crontab file). I'm then using Synchronize Pro X to backup the "things.db.sql " file. I can now relax a little bit. Thanks again! -Mark RE: backing up MySQL databases under OS X. ( msg # 1.1.1: Posted Jun 20, 03 2:37 pm ) Daniel Sroka Level 1 Joined: Jan, 2002 Posts: 51 Yes Ian, THANKS. I was just looking for this solution. Now that you describe it, I realize "Doh! Of course!". Topic: Fried Accounts Panel with niutil!!! Original Message ( Posted Nov 18, 03 7:15 pm ) Paco El Taco Joined: Nov, 2003 Posts: 7 I was noodling with niutil (trying to create hidden user accounts for stuff like SSH and ftp). When I tried to go into the Accounts Panel of System Prefs, it unexpectedly quit on me, and I was left with nothing. How can I fix this? Power Mac G4/400 AGP; Mac OS X (10.3) Messages 10 - 12 of 12 ÊÊ View as Outline Ê|ÊPreviousÊ|ÊView All RE: Fried Accounts Panel with niutil!!! ( msg # 5.: Posted Nov 20, 03 10:19 am ) Paco El Taco Joined: Nov, 2003 Posts: 7 Alright, things just got a whole lot worse... Now my Mac isn't recognizing the User Accounts at all. When I boot up, it goes to the login screen and asks for a username and password. Neither my old user name and password OR root (which I enabled prior to restarting) work. Luckily, I have a working nidump... as a text file on the internet that I can't get to except for printing it out. Unfortunately, when I try to use niload to load the /var/backups/local.nidump that I fixed, it hangs, nothing changed even after running for several hours. (This is booting into single user mode and running the commands it says to allow me to write to the drive.) Here's the command I used, after editing /var/backups/local.nidump to put the comma back. niload -r /Users / < /var/backups/local.nidump Aside from reinstalling the Operating System, what else can I do to restore my old netinfo user table from single user mode? Edit: Let me try it using the correct command: niload -r / -t localhost/local < /var/backups/local.nidump Also, and this is kinda related because I was trying to backup my files in case I had to do a reinstall, when I tried to copy my home directory (using cp /Users/paulrothrock /Volumes/Libraries ) from single-user mode AFTER making sure to run the commands to mount the drives (/sbin/fsck -y ; /sbin/mount -uw /) I got the following error message followed by what looked like a hang: Error: No default Memory Manager defined. RE: Fried Accounts Panel with niutil!!! ( msg # 5.1: Posted Nov 20, 03 12:33 pm ) Gary Kerbaugh Level 4 Joined: Jan, 2001 Posts: 3080 Hi Paul, ÊÊÊI told you to work on a dump of the Users directory, not the entire database. I probably shouldn't have talked about saving a copy of the entire database, local.nidump, in the same paragraph. However the command I gave you was to be applied to an edited dump of the users directory like the one you posted on the web. By applying that to local.nodump, you loaded a copy of the entire database into the users directory so naturally the system can't find any users. ÊÊÊYou should be able to get back where you were by restoring the whole database from the local.nidump. The problem with restoring from Single User Mode is that the NetInfo daemon isn't running so the only command that will work is nicl, which works directly on the files instead of going through the daemon. However, the database isn't in the same format as the nidump so I don't think you can use it. ÊÊÊApple's general discussion of dealing with NetInfo from Single User Mode can be found at Mac OS X, Mac OS X Server: How to Replace the NetInfo Database. I don't think that your procedure will be as complicated as the one they describe because I think that your NetInfo daemon will start up. You don't have a corrupted on, just an incorrect one. Thus, I don't believe that you'll have to create a new one. So here is what I recommend. ÊÊÊBoot into Single User Mode and mount the boot drive. Then execute the commands that start the services necessary for SystemStarter to work: /usr/libexec/kextd /usr/sbin/configd Then execute SystemStarter which, among many other things, will start the NetInfo daemon and load the backup database: /sbin/SystemStarter /usr/bin/niload -d -r -t / localhost/local < /var/backups/local.nidump Then execute "reboot". That should be all there is to it. If, after executing SystemStarter, the NetInfo daemon doesn't start, then you'll have to create a new basic database before doing the above. ÊÊÊAfter all that, you'll have a working machine with a brand-spanking new copy of the database with the empty user. You'll still have to remove that, which shouldn't be a problem after your "dry run". However, this time edit a dump of the users directory if you load using my command or, if you must edit local.nidump, use the niload command in this post to load it. ÊÊÊOh, I don't work in Single Users Mode often enough to have seen any "Memory Manager" complaints but in your copy, "cp", command, use a -r switch to copy recursively. -- Gary ~~~~ ÊÊÊ* Linux Viruscan..... ÊÊÊÊÊÊWindows 95 found. Remove it? (Y/y) ÊÊÊÊÊÊÊÊÊ-- Unknown source G4; Mac OS X (10.3) RE: Fried Accounts Panel with niutil!!! ( msg # 5.2: Posted Nov 20, 03 8:34 pm ) Paco El Taco Joined: Nov, 2003 Posts: 7 Okay, everything's pretty much back to normal. Thanks for all your help. root@Server:~# which killall /usr/bin/killall Since the PATH envrionment variable is not set when crond runs its jobs, it's wise to always use absolute paths in crontabs, i.e. use /usr/bin/killall -c DirectoryService As mentioned by another person, you don't need sudo if you enter the command in the root user's crontab or in /etc/crontab. If you use /etc/crontab, be sure to add the extra 6th field for the user the command should be run as, e.g. root. Here's my /etc/crontab (unmodified). root@Server:~# cat /etc/crontab # /etc/crontab SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin HOME=/var/log # #minute hour mday month wday who command # #*/5 * * * * root /usr/libexec/atrun # # Run daily/weekly/monthly jobs. 15 3 * * * root periodic daily 30 4 * * 6 root periodic weekly 30 5 1 * * root periodic monthly