This is the scenario, client needs to move from database stored file attachments to an actual file share, this allows them to remove 1/4 of their entire database storage needs out to a storage area. Clearly this is a good thing. So, here is the quick run down on what we did:
1. Copy all the existing URL references that contained record:// for backup purposes.
2. Setup a SSH account with a SSH key pair for security
3. Install the SSH key pair into the digital certificates
4. Change all the existing URLs that point to the database storage to the new SFTP storage locations.
5. Run the Orphan cleanup process for File Attachments
6. Copy the file attachments from the OLDURL to the NEWURL
7. Setup the default file attachment server to use the new URL attachment server.
8. Generate a list of all the attachments moved into the file storage and compare that against what was actually in the attachment record
9. Purged the attachment record of all the migrated files.
10. Updated attachment reference records when necessary if they referenced the old URL in any way.
This is where we ran into an interesting problem with unicode characters. The process was relatively slow, and we found that to move approximately 200,000 files took about 40 hours. So to get into production what we did was made a copy of production and run the process in a test environment. Then we moved all the files that we copied to the production file share and than removed all the entries from the database attachment record that were already moved and then ran the tiny subset of new attachments out to the storage so we could minimize our downtime.