0

I want to move Jenkins from one server to another Server/container(docker).

This is not about Jenkins Data Migration.

Jenkins need to migrate without installing Jenkins in the target machine. I mean, have to copy all the installation files required for running the service Jenkins.

I know some entries are there in /bin/ folders.

Otherthan that almost I moved Jenkins configuration related files

/usr/share/Jenkins
/var/lib/Jenkins
/etc/init.d/Jenkins

from Source machine to Target machine but while starting Jenkins service, Jenkins is failing to start.

Is there any way to do the same?

Thanks in advance for help.

Prakash26790
  • 297
  • 2
  • 18
  • If it fails there should be an error message or warning – Marged Sep 25 '19 at 06:29
  • @Marged I'm not getting the logs. Just indicating [Fail]. See the Response root@395cfc4f4aa4:/# /etc/init.d/jenkins start Correct java version found * Starting Jenkins Automation Server jenkins [fail] – Prakash26790 Sep 25 '19 at 10:05

1 Answers1

1

Normally this is not the practice to move an executable file from one machine to another, as there are not only the executable that needs to move, there is some configuration related to an executable file which is stored in the underlying machine.

You can check this post portability-of-an-executable-to-another-linux-machine

The best way is to make an image something similar to amazon AMI, is a read-only filesystem image that includes an operating system (e.g., Linux, Unix, or Windows) and any additional software required to deliver a service or a portion of it, and restore the image in the target machine.

In case of a container, you do not install anything, just install the Docker in the target machine and run the below command.

docker run --name myjenkins -p 8080:8080 -p 50000:50000  jenkins:alpine

As containers are already portable, build the image once and run it anywhere.

Bonus with Container:

jenkins:alpine this is offical Jenkins image which is just 160MB and the size of base image is just 5MB.

Adiii
  • 35,809
  • 6
  • 84
  • 87