My understanding is that you have an old server that it somewhat still capable and you want to convert it so that it now runs LXD and the old services are now into a LXD container. You might have to use an extra disk or special partitioning when you install Ubuntu 18.04 on the Ubuntu 12.04 server until you retrieve the files.
Generally, if you have an existing installation of Linux and you want to convert into a LXD container, you can use the lxd-p2c
utility. This is useful if you do not want to reinstall from scratch. There is a nice tutorial for this below,
Alternatively, LXD and specifically the ubuntu:
repository of container images still has Ubuntu 12.04 container images. Therefore, if your old server is dependent on Ubuntu 12.04, you can launch an Ubuntu 12.04 container and set it up there by reinstalling or moving the services.
Here is how you launch an Ubuntu 12.04 container: lxc launch ubuntu:12.04 mycontainer