Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: Make Time Machine work well with Entourage 2004 Apps
This hint will put your Entourage 2004 database on a sparse bundle, which Time Machine knows how to use for a true incremental backup. I am using this for Entourage, but it will probably work OK with Paralells' or VMware's virtual machines, too -- I just don't know about the speed issue.

Sorry, much of this is kind of advanced, but if you don't understand what you are doing here, you are probably better off not using this method. If something goes wrong after an update, you will have a hard time figuring out what happened, and getting to your email. This is not a hint for those with only a basic knowledge of the system...

Basically this is how I made a Sparse Bundle mount to an odd mount point on system boot. I am going to use my Entourage installation as an example, and I'm not going to explain every step in the ultimate low-level of detail, so watch what you are doing.

  1. Create the Sparse Bundle in Terminal. First see how big your current database is:
     $ cd ~/Documents/Microsoft\ User\ Data/
     $ du -hs Office\ 2004\ Identities
     2.5G    Main Identity/
    My Entourage folder is 2.5GB, and when I create my Sparse Bundle, I want it to have enough room to grow. So I used Disk Utility to make an image:
    • Save As: Entourage.sparsebundle
    • Location: ~/
    • Name: Entourage Database
    • Size: Custom (10GB)
    • Format: Mac OS Extended (journaled)
    • Encryption: none
    • Partition: No Partition Map
    • Image Format: sparse bundle disk image
    Hit Save, and then eject the disk.
  2. Move your current data. Quit all of your MS Office programs, and do not start them again until you're done here. Be sure that nothing is accessing your Main Identity folder, using Terminal:
     $ lsof | grep "Microsoft User Data"
    You may see your own applications in the list, but that is not a big deal. Rename your Office 2004 Identities folder:
     $ cd ~/Documents/Microsoft\ User\ Data/
     $ mv Office\ 2004\ Identities Office\ 2004\ Identities.BACKUP
     $ mkdir Office\ 2004\ Identities
     $ ls -dl Office\ 2004\ Identities*
    Be sure that the file owner, group, and permissions are the same.
  3. Make a script to mount your sparse bundle to your new directory, using Terminal:
     $ cd
     $ mkdir -p unix/scripts
     $ cd unix/scripts
     $ touch mountentourage
     $ chmod 750 mountentourage
     $ nano mountentourage
    This should be the contents of the mountentourage file:
    #!/bin/sh
    
     /usr/bin/hdiutil attach "/Users/USER/Entourage.sparsebundle" \
       -mountpoint "/Users/USER/Documents/Microsoft User Data/Office 2004 Identities" \
       -owners on -notremovable -nobrowse
    Obviously, change the USER directory to your user's home directory. If you copy and paste the above, be sure that there are no trailing spaces at the end of the lines. Exit nano, saving your changes. You should now have an executable file that mounts your disk image to your datastore:
     $ ./mountentourage
     /dev/disk2              Apple_partition_scheme
     /dev/disk2s1            Apple_partition_map
     /dev/disk2s2            Apple_HFS
    /Users/USER/Documents/Microsoft User Data/Office 2004 Identities
    And df should now show your mapping:
     $ df
     Filesystem    512-blocks      Used Available Capacity  Mounted on
     /dev/disk1s9   320144448 150973320 168659128    48%    /
     devfs                233       233         0   100%    /dev
     fdesc                  2         2         0   100%    /dev
     /dev/disk0s3   624880224 290918680 333961544    47%    /Volumes/Backup
     map -hosts             0         0         0   100%    /net
     map auto_home          0         0         0   100%    /home
     /dev/disk2s2    20971520     72480  20899040     1%    /Users/USER/Documents/Microsoft User Data/Office 2004 Identities
  4. Execute the script at startup. (Oh how I long for the days of good old simple /etc/rc). In Terminal:
     $ hdiutil detach disk2
     $ df 
     // The drive should no longer be mounted
     $ cd /Library/LaunchDaemons
     $ sudo nano user.USER.mountentourage.plist
    This should be the contents of the user.USER.mountentourage.plist file:
    <?xml version="1.0" encoding="UTF-8"?>
     <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
     <plist version="1.0">
     <dict>
         <key>Label</key>
         <string>user.USER.mountentourage</string>
         <key>ProgramArguments</key>
         <array>
             <string>/Users/USER/unix/scripts/mountentourage</string>
         </array>
         <key>RunAtLoad</key>
         <true/>
     </dict>
     </plist>
    Exit nano, saving your changes. Then execute these Terminal commands:
     $ ls -l
     -rw-r--r--  1 root  wheel  398 Jun  4 16:11 user.USER.mountentourage.plist
     $ sudo launchctl load user.USER.mountentourage.plist
     $ df
    If all went well, you will now see your entourage directory mounted. Verify that after a system restart, df shows you your mount.
  5. Test and populate your new image. One final check of the mount first:
     $ cd ~/Documents/Microsoft\ User\ Data/Office\ 2004\ Identities
     $ touch testfile
     $ ls
     testfile
     $ cd ..
     $ df | grep Microsoft
     $ hdiutil detach disk2
     $ cd Office\ 2004\ Identities
     $ ls
     // The file testfile should not be here
     $ cd ..
     $ sudo launchctl unload /Library/LaunchDaemons/user.USER.mountentourage.plist
     // (because it was loaded at startup)
     $ sudo launchctl load /Library/LaunchDaemons/user.USER.mountentourage.plist
     $ df
     $ cd Office\ 2004\ Identities
     $ ls
     testfile
     $ rm testfile
     $ cd ..
     $ cp -prv Office\ 2004\ Identities.BACKUP/* Office\ 2004\ Identities/
    At this point, your data should be loaded and ready to go. I choose to back my Office 2004 Identities.BACKUP directory just to be safe:
     $ mv Office\ 2004\ Identities.BACKUP /Volumes/Backup/
  6. Configure Time Machine. While all of the data that you have looks like it resides in ~/Documents » Microsoft User Data » Office 2004 Identities, technically, that is now another Volume. Since those are the big files that you were probably ignoring before, you still don't want to back them up directly. So go to your Time Machine options and make sure that "Entourage Database" is in the "do not backup" list.
The good news is that all of the data that resides on "Entourage Database" now resides in a sparse bundle in your home directory, and that is backed up. And with the ingenious way that Apple made a sparse bundle work, you now have incremental backups of your Entourage database at a minimal space cost.

[robg adds: I haven't tested this one...]
    •    
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[18,732 views]  

10.5: Make Time Machine work well with Entourage 2004 | 11 comments | Create New Account
Click here to return to the '10.5: Make Time Machine work well with Entourage 2004' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Make Time Machine work well with Entourage 2004
Authored by: carmst on Jun 06, '08 08:53:37AM

This is a really great idea!

Maybe it's obvious to others but it wasn't quite clear to me at first how it worked... The key is that Apple's sparse bundle volumes are invisibly split up into small 8MB files, which OSX reassembles into a contiguous volume when the bundle is mounted.

Making a small, 1KB change to a 10GB file would ordinarily mean Time Machine would have to copy the full 10GB file again. If it's stored in a sparse bundle instead, only the 8MB chunk that contains the change would need to be backed up. Cool!



[ Reply to This | # ]
10.5: Make Time Machine work well with Entourage 2004
Authored by: seika7 on Jun 06, '08 09:29:34AM

Thanks for the explanation; that is a cool idea!



[ Reply to This | # ]
10.5: Make Time Machine work well with Entourage 2004
Authored by: robdew on Jun 06, '08 12:31:42PM

this is a great idea, but thinking this through I am pretty sure this means if you want to restore from a TM backup, you have to restore the whole sparsebundle, right?

Still, not a bad tradeoff though.



[ Reply to This | # ]
10.5: Make Time Machine work well with Entourage 2004
Authored by: inik on Jun 06, '08 03:33:04PM

Yes, but you can restore to any point in time. So message-level restores aren't possible, but snapshots are.



[ Reply to This | # ]
You don't need the script
Authored by: inik on Jun 06, '08 03:35:44PM

You can just use an alias instead.

Just copy your identity's folder (Documents: Microsoft User Data: Main Identity:) to your disk image, and put an alias to that folder in the place of your "Main Identity" folder. Provided your image is mounted, it'll all work just fine.



[ Reply to This | # ]
10.5: Make Time Machine work well with Entourage 2004
Authored by: rjbailey on Jun 06, '08 04:45:35PM
This is a great hint. I tried it with two modifications:
  • I used Lingon to create a login item instead of the method suggested. I just like Lingon.
  • It only activates when I log in--rather than when the computer restarts--so, since it doesn't run with root privileges, the "-notremovable" option cannot be used else I get a permissions error.

    [ Reply to This | # ]
  • Same solution for SuperDuper?
    Authored by: jpalten on Jun 07, '08 03:20:24PM

    Would this also work for SuperDuper smart duplication? I use TimeMachine for the incremental backups (to a Time Capsule), and SuperDuper for disk duplication to an external disk. This way, when my hard disk crashes, I can just boot from the extrernal (SuperDuperCopied) disk and continue business as usual. SuperDuper has an option where it uses 'Smart Update' to update the copy, only updating the files that have changed.
    So I was wondering, does SuperDuper recognize the Sparse Image Bundle as a collection of smaller files, or will it rewrite the comple Sparse Image?



    [ Reply to This | # ]
    SuperDuper caution
    Authored by: jpalten on Nov 26, '08 04:09:35AM
    I use the above method to create a sparseimage for my parallels virtual machine on the Mac. When I use SuperDuper to make a (readonly) disk image of my harddisk as backup, it copies both the sparseimage and the contents of the mounted image. This results in a backup that is bigger than the original disk, and cannot be restored. My advice here: you can use SuperDuper, but either:
  • make sure you unmount the sparseimage before making a disk image as backup, or
  • exclude the contents of the mounted image from the backup, or
  • at least check the size of the resulting backup and remove the duplicated content of the sparseimage after the backup if the size is a problem (not the sparseimage itself).
  • I assume the same problem could occur with time machine, if you forget to exclude the mountpoint.

    [ Reply to This | # ]
    10.5: Make Time Machine work well with Entourage 2004
    Authored by: lucite on Jun 09, '08 11:16:54AM

    Would this work with Entourage 2008 as well - I have a vague sense that they changed something in the DB format...



    [ Reply to This | # ]
    10.5: Make Time Machine work well with Entourage 2004
    Authored by: Jayce on Jun 10, '08 05:36:42AM

    Good idea.
    Just a question about this tip for virtual hard disk like thoses of Parallels, Fusion or VirtualBox :
    What about the perfs ?
    It is one level more between the hard disk and the virtual OS... Is someone have tested ?



    ---
    --
    Jayce Piel - MosX.org redactor



    [ Reply to This | # ]
    Cautions with live database?
    Authored by: ewilen on Apr 09, '09 11:52:59AM
    This seems like a good solution to managing the size of Entourage backups, although rather complex. However it's not clear how this solution deals with the fact that both Entourage and the database daemon need to be shut down. See http://support.microsoft.com/kb/946961

    If understand correctly, if either of those programs are running during a backup, you risk creating a corrupted snapshot. True, you can go back to an earlier snapshot and hope for the best, but you've still lost your most recent data. Furthermore shutting down database daemon isn't a trivial task for end users. What are the options?

    1) Use Database Utility to turn off running database daemon whenever Entourage isn't running. 'Course then, you need to worry even more about database corruption.

    2) Implement one of the solutions over at mvps.org, such as: this or this. These make local backups of the database; in the context of this trick, those local backups are what you'd put on the sparse bundle.

    Either way you need to get users to quit Entourage every once in a while, and if they don't--you either get no backup, or a good chance of a corrupted backup.

    Add in the complexity of full implementation and I see this, overall, as useful only for (1) power users managing their own machines (2) small numbers of Mac users in a business site (3) a developer out there who can package a solution.

    [ Reply to This | # ]