Network function virtualization (NFV) and software defined networking (SDN) are two promising technologies to enable 5G and 6G services and achieve cost reduction, network scalability, and deployment flexibility. However, migration to full SDN/NFV networks in order to serve these services is a time consuming process and costly for mobile operators. This paper focuses on energy efficiency during the transition of mobile core networks (MCN) to full SDN/NFV networks, and explores how energy efficiency can be addressed during such migration. We propose a general system model containing a combination of legacy nodes and links, in addition to newly introduced NFV and SDN nodes. We refer to this system model as partial SDN and hybrid NFV MCN which can cover different modes of SDN and NFV implementations. Based on this framework, we formulate energy efficiency by considering joint routing and function placement in the network. Since this problem belongs to the class of non-linear integer programming problems, to solve it efficiently, we present a modified Viterbi algorithm (MVA) based on multi-stage graph modeling and a modified Dijkstras algorithm. We simulate this algorithm for a number of network scenarios with different fractions of NFV and SDN nodes, and evaluate how much energy can be saved through such transition. Simulation results confirm the expected performance of the algorithm which saves up to 70% energy compared to network where all nodes are always on. Interestingly, the amount of energy saved by the proposed algorithm in the case of hybrid NFV and partial SDN networks can reach up to 60-90% of the saved energy in full NFV/SDN networks.