We wanted to build a new website in top of an existent SF instance.
: The following technique supposed you are familiar with
the Sitefinity database and with user-defined function in SQL (CLR). If
not, do not attempt to use it, you can break everything in your
Images & Documents Library !
We renamed the files already uploaded in Images and Documents (it was quite a mess).
To do so
- Get a copy of the files
- Rename it on the file system correctly
- Batch uploaded them to the new DB with correct categories and tags.
The problem was the upload date
. How to change the original date to keep this information ?
To do so, we used a Hash technique, based on CLR.
Create a new SQLServerProject to deploy the user defined functions
"Don't know how to create a '"
+ HashAlgorithmName +
[Microsoft.SqlServer.Server.SqlFunction(DataAccess = DataAccessKind.None, IsDeterministic =
, SystemDataAccess = SystemDataAccessKind.None)]
SqlBinary Hash(SqlBytes Source, SqlString HashAlgorithmName)
HashAlgorithm ha = GetHashAlgotithm(HashAlgorithmName.Value);
SqlBinary theHash =
Secondly, you can use this function in SQL to compute files hash and get information you need.
All you got to do is to use a inner join between databases to update the creation date.
Et voilà !
Thanks to Walden : http://blog.waldenl.com/2009/12/computing-md5-hash-of-varbinarymax-in.html