function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mcrispin@safeschools.commcrispin@safeschools.com 

Instance change this weekend and starting to panic; how to actually change the hard coded URL's once located?

We have an split coming up this weekend and need to change all of our hard coded URL's and I'm really starting to panic!  Please know I have referenced the documentation on the URL splits.  I've got the Eclipse up and running and I'm able to find our hard coded URL's.  I know we need to remove the "na2" from the URL's. After this is where I'm lost.

I've run a general search and already found 260 instances that reference "na2".  How do I edit these URL's?.  Will we need to manually locate each reference and change each through the UI?  If so, I tried to manually change the URL of our home page company logo by locating that graphic in our documents folder, right clicked for URL, removed the na2.content.force.com, and then selected the "Create a reference link to the file. Enter a file location that others can access."  When I load the URL reference without the instance, the graphic breaks.  Is this b/c the URL on the graphic needs to be changed and then reloaded in SF?  If this is the case, is there a way to change any of the other references from the back end that are not graphics?  Are there any cases where the instance portion of the URL will be ignore and making an update is not necessary?  Thank you for any additional direction you can give!!
Best Answer chosen by mcrispin@safeschools.com
mcrispin@safeschools.commcrispin@safeschools.com
I'm following up with my journey on this one for the next solo admin that has as much experience as I did on the development side of things.  To remove all hard coded URL's you'll need to search for them using the Force.IDE tool via Eclipse.  This is a backend tool that allows you to access and manipulate data in your org (amongst many other things.)  Links to download this tool can be found on Developer.Salesforce.com site and is pretty well documented in the instance change documentation you've been receiving.  Once you've downloaded this tool, you need to create a "Project" that limits the objects/data this tool will use to to run your search on. If you run into errors, I found it's because there are limits to how much data this tool can handle, so try to select a smaller set of data and that should do the trick.  Once this is all set up, you'll need to "Search and Replace" the URL's that are found in the group of data you've set aside in your project.  Keep in mind this function only updates your locale files and will need to be moved to your production site after edits are complete.  When you're ready to move your edits to production, I suggest updating one or two files to verify things are updating as expected.  This is done by selecting a small subset or folder of the project you've edited, right mouse click and select "Force.com" followed by "Deploy to Server".  Follow the prompts and verify all changes are correct before moving on to executing on larger groups of data.  Hopefully this will save you the entire day I've spent figuring this all out. 

All Answers

SlashApex (Luis Luciani)SlashApex (Luis Luciani)
Hello,

You will need to modify any Custom Code, custom button or links, email templates, formula fields, workflows, etc that have the url hardcoded. When we went through this we used eclipse for all that. I am not entirely sure I follow what you mentioned, but anything that you configure through the UI without writing code should point to the correct location after the split.

Example: Document containing image that is referenced on the App Header logo. That does not need any modification.

Basically concentrate on anything that is coded.

I will share a summary of what I gave my team when we had to go over this:

In General
Try to use relative URLs instead of the full URL. 

Relative URL: /apex/MyPage
Full URL: na4.salesforce.com/apex/MyPage

In Apex
If you see : https://na4.salesforce.com
You can replace it with: URL.getSalesforceBaseUrl().toExternalForm()

In VF Pages
Use relative URLs.
mcrispin@safeschools.commcrispin@safeschools.com
Thanks for the clarification, big help!  I understand any email templates containing hard coded references will also need to be changed.  I tooled around in Eclipse and noticed the find and replace function.  Can this be used to edit these URL's?  Will the changes need to be migrated?  (Entering uncharted territory here...)
SlashApex (Luis Luciani)SlashApex (Luis Luciani)
Hello!

Yes, you will have to make this changes in a sandbox first and then migrate them to your production environment. Some changes (Point n Click stuff) you could make directly in production, but you would have to do them manually. Eclipse will only let you save your changes to your sandbox.

Reach out to me if you are interested in some help.
http://bit.ly/1EBWcuj
 
mcrispin@safeschools.commcrispin@safeschools.com
I'm following up with my journey on this one for the next solo admin that has as much experience as I did on the development side of things.  To remove all hard coded URL's you'll need to search for them using the Force.IDE tool via Eclipse.  This is a backend tool that allows you to access and manipulate data in your org (amongst many other things.)  Links to download this tool can be found on Developer.Salesforce.com site and is pretty well documented in the instance change documentation you've been receiving.  Once you've downloaded this tool, you need to create a "Project" that limits the objects/data this tool will use to to run your search on. If you run into errors, I found it's because there are limits to how much data this tool can handle, so try to select a smaller set of data and that should do the trick.  Once this is all set up, you'll need to "Search and Replace" the URL's that are found in the group of data you've set aside in your project.  Keep in mind this function only updates your locale files and will need to be moved to your production site after edits are complete.  When you're ready to move your edits to production, I suggest updating one or two files to verify things are updating as expected.  This is done by selecting a small subset or folder of the project you've edited, right mouse click and select "Force.com" followed by "Deploy to Server".  Follow the prompts and verify all changes are correct before moving on to executing on larger groups of data.  Hopefully this will save you the entire day I've spent figuring this all out. 
This was selected as the best answer