moving jenkins to a new RH server

12 views
Skip to first unread message

Matthias Apitz

unread,
Jul 3, 2023, 2:20:32 AM7/3/23
to jenkins...@googlegroups.com

Hello,

We run jenkins on a RH 7.9 server in version 2.164.1-1.1 and are on the
way to setup a newer version on jenkins on a new RH server 8.7.
What would be the best way to move all the configuration and jobs to the
new server after installing jenkins?

Thanks

matthias

--
Matthias Apitz, ✉ gu...@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub

Thomas Markus

unread,
Jul 3, 2023, 2:28:52 AM7/3/23
to jenkins...@googlegroups.com
Hi,

Am 03.07.23 um 08:20 schrieb Matthias Apitz:
> Hello,
>
> We run jenkins on a RH 7.9 server in version 2.164.1-1.1 and are on the
> way to setup a newer version on jenkins on a new RH server 8.7.
> What would be the best way to move all the configuration and jobs to the
> new server after installing jenkins?
>
> Thanks
>
> matthias
>
for me it was sufficient to clone jenkins home. In detail I copied
folders fingerprints, plugins, secrets, users, jenkins-jobs, jobs

hth
Thomas
OpenPGP_0x9794716335E9B5AF.asc
OpenPGP_signature

Matthias Apitz

unread,
Jul 5, 2023, 2:28:41 AM7/5/23
to jenkins...@googlegroups.com
El día lunes, julio 03, 2023 a las 08:28:30a. m. +0200, Thomas Markus escribió:

> >
> for me it was sufficient to clone jenkins home. In detail I copied folders
> fingerprints, plugins, secrets, users, jenkins-jobs, jobs
>
> hth
> Thomas

Thomas,

Thanks for your reply. When I use your dir list as user 'root' with tar:

# tar chzf jenkinsHome.tar.gz fingerprints plugins secrets users jenkins-jobs jobs

and I have to use the flag 'h' because some of the dirs are symlinks, I
get a lot of messages like this:

...
tar: jobs/SLNPBasic-V7.1/builds/lastStableBuild: File removed before we read it
tar: jobs/SLNPBasic-V7.1/builds/lastFailedBuild: File removed before we read it
tar: jobs/SLNPBasic/builds/lastUnstableBuild: File removed before we read it
...
and these symlinks all point to nowhere:

# ls -l jobs/SLNPBasic-V7.1/builds/lastStableBuild
lrwxrwxrwx 1 jenkins jenkins 2 Jul 30 2020 jobs/SLNPBasic-V7.1/builds/lastStableBuild -> -1

What does this mean (the symlink to '-1') and how to deal with this?

Thomas Markus

unread,
Jul 5, 2023, 2:37:35 AM7/5/23
to jenkins...@googlegroups.com
Hi,

Am 05.07.23 um 08:28 schrieb Matthias Apitz:
> Thomas,
>
> Thanks for your reply. When I use your dir list as user 'root' with tar:
>
> # tar chzf jenkinsHome.tar.gz fingerprints plugins secrets users jenkins-jobs jobs
>
> and I have to use the flag 'h' because some of the dirs are symlinks, I
> get a lot of messages like this:
>
> ...
> tar: jobs/SLNPBasic-V7.1/builds/lastStableBuild: File removed before we read it
> tar: jobs/SLNPBasic-V7.1/builds/lastFailedBuild: File removed before we read it
> tar: jobs/SLNPBasic/builds/lastUnstableBuild: File removed before we read it
> ...
> and these symlinks all point to nowhere:
>
> # ls -l jobs/SLNPBasic-V7.1/builds/lastStableBuild
> lrwxrwxrwx 1 jenkins jenkins 2 Jul 30 2020 jobs/SLNPBasic-V7.1/builds/lastStableBuild -> -1
>
> What does this mean (the symlink to '-1') and how to deal with this?
>
> Thanks
>
> matthias
>
It means these files are removed/changed while tar is running. Looks
like your jenkins instance is running and a build job was executed so
symlink for last build changes.
Personally I use rsync for sync to remote location. To overcome this you
can use snapshots on filesystem support or block any filesystem
modification while tar is running

best regards
Thomas

OpenPGP_0x9794716335E9B5AF.asc
OpenPGP_signature

Matthias Apitz

unread,
Jul 5, 2023, 3:59:32 AM7/5/23
to jenkins...@googlegroups.com
El día miércoles, julio 05, 2023 a las 08:37:15 +0200, Thomas Markus escribió:

> > tar: jobs/SLNPBasic-V7.1/builds/lastStableBuild: File removed before we read it
> > tar: jobs/SLNPBasic-V7.1/builds/lastFailedBuild: File removed before we read it
> > tar: jobs/SLNPBasic/builds/lastUnstableBuild: File removed before we read it
> > ...
> > and these symlinks all point to nowhere:
> >
> > # ls -l jobs/SLNPBasic-V7.1/builds/lastStableBuild
> > lrwxrwxrwx 1 jenkins jenkins 2 Jul 30 2020 jobs/SLNPBasic-V7.1/builds/lastStableBuild -> -1
> >
> > ...

> It means these files are removed/changed while tar is running. Looks like
> your jenkins instance is running and a build job was executed so symlink for
> last build changes.
> Personally I use rsync for sync to remote location. To overcome this you can
> use snapshots on filesystem support or block any filesystem modification
> while tar is running

I looked into the build directory (and Jenkins was not running):

# ls -l jobs/SunRise-WMS-Migration-Tools/builds/
...
drwxr-xr-x 2 jenkins jenkins 4096 10. Sep 2021 998
drwxr-xr-x 2 jenkins jenkins 4096 10. Sep 2021 999
lrwxrwxrwx 1 jenkins jenkins 4 21. Okt 2021 lastFailedBuild -> 1361
lrwxrwxrwx 1 jenkins jenkins 4 23. Jan 15:01 lastStableBuild -> 5583
lrwxrwxrwx 1 jenkins jenkins 4 23. Jan 15:01 lastSuccessfulBuild -> 5583
lrwxrwxrwx 1 jenkins jenkins 2 22. Apr 2021 lastUnstableBuild -> -1
lrwxrwxrwx 1 jenkins jenkins 4 21. Okt 2021 lastUnsuccessfulBuild -> 1361

it looks like the symlink 'lastUnstableBuild' -> -1 just means, no
information available; as well it is not shown in the dashboard of the
job; there are only:

Permalinks

Last build (#5583), 5 mo 12 days ago
Last stable build (#5583), 5 mo 12 days ago
Last successful build (#5583), 5 mo 12 days ago
Last failed build (#1361), 1 yr 8 mo ago
Last unsuccessful build (#1361), 1 yr 8 mo ago
Last completed build (#5583), 5 mo 12 days ago

I will just ignore the errors. As well the following cmd shows that all
'lastUnstableBuild' are symlinks to -1:

find -L jobs -name lastUnstableBuild -exec ls -l {} \; | grep -v -- '-1'
Reply all
Reply to author
Forward
0 new messages