Ten years ago, in a time of crisis, Portland officials reached out to Joe Gray.

High-profile City Manager Bob Ganley had just died unexpectedly, and the city needed a leader who could step in without missing a beat.

They picked Gray, the planning director who had been on the city staff for 30 years. While he might have lacked Ganley’s flair for drama, he took a back seat to no one when it came to understanding how the city functioned.

They were looking for continuity in managing the development that began under Ganley’s leadership, and, until a national recession brought commercial building to a standstill, they got it.

On Tuesday, Gray announced his retirement, effective in February, bringing an end to an era of city government during which Portland was transformed from a run-down port looking for a post-industrial future in the 1960s to the gleaming service center we know today, regularly making national lists of the best places to live.

During Gray’s time at City Hall, he has been instrumental in community planning processes that led to the Bayside vision, the Ocean Gateway development and the Eastern Waterfront plan.

The 50 miles of trails that wind around Back Cove and along the Presumpscot River and also connect neighborhoods started as an idea that emerged from Gray’s planning office in the 1980s.

Now that Gray has announced his retirement after 40 years of service, Portland is facing another kind of crisis. After three austere budgets, the city is looking at another year when key services may be on the line.

The message from Augusta and Washington is that the city will not be able to count on help from outside to continue funding its programs.

And while there are some reasons for optimism, commercial real estate development is not going to be a quick savior.

At the same time, the city is going through the biggest change in its political structure in nearly a century. For the first time since the 1920s, Portlanders will go to the polls and directly elect their mayor.

What the city’s leaders will be looking for in a manager now will be different from the criteria a decade ago. They should be looking for someone comfortable in a fast-changing environment who can manage budgets while putting the meat on the policy bones developed by the new mayor and City Council.

It’s time to undertake a new direction with a lot of unknowns, including the identities of the key players.

But the process of hiring a new city manager is rightly beginning now, and will not wait for the upcoming election.

At the same time, it should not be pushed too quickly.

There are two good local examples of successful search and hire processes. In 2007 and 2008, the city dealt with vacancies for both the school superintendent and the chief of police. In both cases, an interim replacement was hired while the city conducted a national search. Both Superintendent James Morse and Police Chief James Craig have been successful new leaders for their agencies.

Portland officials should not limit themselves to people with experience in Portland, in Maine or even in city government. There are talented managers in the private sector who would welcome the challenge of running a complex, 1,300-employee organization.

And if they are lucky, they will find someone as dedicated as Gray. As he was saying goodbye to a room full of employees Tuesday, Gray looked back at his 40 years of service, saying “each day, I tried to make a contribution to making Portland a better place.”

Forty years later, it is, and as the city gets ready for the next chapter, it can be grateful for his service.