I have a remote CentOS server (Release 6.10) set up by someone else. I have quite a few perl modules installed on the machine.
I have set up a local CentOS server (Release 7.7.1908). I would like to have the EXACT same set of perl modules on my local machine. Installing them one by one via cpan is an option but I can run into issues as some of the perl modules are older (very) versions.
I was wondering, if I can copy modules from the remote server to my local server. Can I do that? Are there other options?
2
Answers
The solution suggested by Andy Lester is perhaps the best way to do it. I found a documentation here in addition to ones suggested.
In my case however this was not straight forward because the source server environment is very old and there were many dependencies that I will need to manually resolve. In general if you have similar environments and clean installs, the auto bundle approach will make it easy.
It’s not safe to copy modules from one machine to another because things may not be set up identically. It’s best to reinstall them.
You can use the
autobundle
command in thecpan
shell to create a dump of all the modules you have installed on the old machine. You can then use that dump to tell thecpan
shell on the new machine what modules to install.Thanks to Polar Bear, here’s a link to an article that explains how to reinstall the autobundle.