ReplaceTool - Globally replace everything in your project with zero efforts

ReplaceTool - Globally replace everything in your project with zero efforts

Posted on December 15, 2008 0 Comments

The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

Have you ever needed to change a single e-mail, located on 2000 pages with an another one? Have you experienced the problem to update 5000 links in your web site? While running some SQL queries against the project database may do the trick, the chance to screw something is pretty big due the number of relations between the tables in the database. That is why we always suggest using the APIs for changing the content items.

In fact we had some problems with the upgrades, to be more specific, in some cases the links to library items, containing whitespaces were broken after upgrading to Sitefinity 3.5. The whitespaces in 3.5 should have been replaced with underscores. But how do you change, let's say 300 images urls, managed in different libraries manually?

Here's a tool that will help you. You can either search and replace terms, or use regular expressions to find content or items you need to change. It is working with our APIs, and it is not compiled so you may take look at its source.

The tool itself is specially prepared for Sitefinity - it is using the ITool interface, which allows you to build components and easily plug them to the Sitefinity CMS. Here is how it looks like:Shot

 

Please follow these steps to include the tool in your project:

1. Download ReplaceTool

Here are the steps you should follow in order to enable ReplaceTool in your project:

2. Extract [Archive]\App_Code\ReplaceTool.cs file to \[YourProject]\App_Code directory

3. Extract [Archive]\Tools directory to your \[YourProject]\Tools directory. If you do not have Tools directory, please create it.

4. Open your web.config file, and add the line to the <tools> node:

<tools> 
... 
<add type="Telerik.Cms.Tools.ReplaceTool, App_Code" /> 
</tools> 

5. Give the asp.net worker process read access to the newly created files (steps 1 and 2).

6. Run the project and browse to Administration->Tools->ReplaceTool

 

Please note that there is no "Undo" function yet. This means that you should backup your database in case you want to give it a try. The tool can be used only by users in the Administrators role (don't ask me why :) )

 

I hope it would also be helpful for you, if you want to see how to change pages, content items and control properties programmatically.

Let me know if you have any questions on the matter.

progress-logo

The Progress Team

View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments

Comments are disabled in preview mode.
Topics

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation