Best way to split a database

I have a database with all my emails in. Some 85K emails. I’d like to split the database and have one with the least 3 years of emails and an archive for the rest.

What’s the best way to achieve this? Duplicate and delete redundant data or create a new one and move data, or is there a better option?

When moving large quantities of data, based on posts in the forum some have found that

  • duplicating is more reliable than moving
  • moving is more reliable when done in smaller batches

I think I would first duplicate the old records to a new database (you could even use a smart rule to do so; you could tag each record in the original database which was duplicated that way, and then move the tagged records from the original database to trash).

As always, an up-to-date backup is recommended before undertaking major changes.

In order to move large numbers of files between databases, it is often a wise idea to use File > Export > Files and Folders to a newly created folder in your Home Directory. (In Open / Save dialogs or the Finder, you can get to your Home Directory quickly by pressing Shift-Command-H.)

  1. Select the records to move in the source database.
  2. Choose File > Export > Files and Folders and choose (or create) a folder on your Desktop. This is important as it keeps any ungrouped files from being mixed in with other files accidentally.
  3. After the export is finished, switch to the destination database and choose File > Import > Files and Folders. Select the contents of the folder from Step 2, not the folder itself.

Except for the Date Added, this should maintain the metadata for the files. When the process is finished (and a quick visual inspection is not a bad idea), you can do a File > Verify & Repair to ensure the destination database’s integrity.

And yes, you should be certain your primary backups are current, not only now but in general. :slight_smile:

2 Likes

Many thanks for your help.

In the end I created a smart group with the date created pointing to the year range I wanted. I also made sure that the smart group didn’t include groups or other smart groups. I then exported the content of the smart group and re-imported into a new database. This seem to have worked.

2 Likes