Because of the structure of the tests, it is not possible to change a test from Last Mile to Private Last Mile or the other way around. Data gathered from Last Mile, which uses a global network of real end users, is not directly equivalent to data gathered from a Private Peer network, which is limited to computers on which your organization has installed a Private Peer agent. Combining data from both networks in the history of a single test would present potentially misleading and confusing information.
However, in the Dynatrace Portal, you can use the same script or URL(s) to create separate tests for Last Mile and Private Last Mile.
For detailed instructions for creating tests, see Adding tests in the Dynatrace Synthetic documentation.