OT Expert re retaining wall

On one of our boundaries we have a 3 feet hugh retaining wall because the land the other side is lower. Just inside that is a 6 feet high fence. Wall is leaning off its foundations and fence posts are leaning as a result of soil movement in the area. We would like to replace the wall either as a complete wall or as previous with a wall topped by a fence. The situation is complicated by a 40ft tree close to the boundary. What sort of expert should we contact for advice or where can we look? Surveyor, engineer, landscaping expert or someone else? Overall there is about 60 feet involved and it is going to be a big and expensive job we want to last a long time.
Thanks in advance for any advice.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
Add image file

HomeOwnersHub.com is a website for homeowners and building and maintenance pros. It is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.