Jenkins job build history lost after migrating workspace to a new hard drive
I am currently running Jenkins ver. 2.121.2. I am in charge to migrate all jenkins builds and workspace to a new location since we have many projects filling our system's SSD. And we decided to have the workspace and build location to be on a HDD. Migrating all the data wasn't hard but the unexpected side effect is, that all jenkins jobs have lost their build history. I thought it would be as simple as copying all files over to the new location.
I changed only 2 parameters in the /var/lib/jenkins/config.xml
file. These are from:
<workspaceDir>$ITEM_ROOTDIR/workspace</workspaceDir>
<buildsDir>$ITEM_ROOTDIR/builds</buildsDir>
To...
<workspaceDir>/wd-red1/jenkins_workspace/$ITEM_FULLNAME</workspaceDir>
<buildsDir>/wd-red1/jenkins_builds/$ITEM_FULL_NAME</buildsDir>
Then I have copied all files from /var/lib/jenkins/workspace
and /var/lib/jenkins/jobs
respectively to the locations above. All went well except for the job build histories.
My question is: Can I somehow import the job build history too?
jenkins
add a comment |
I am currently running Jenkins ver. 2.121.2. I am in charge to migrate all jenkins builds and workspace to a new location since we have many projects filling our system's SSD. And we decided to have the workspace and build location to be on a HDD. Migrating all the data wasn't hard but the unexpected side effect is, that all jenkins jobs have lost their build history. I thought it would be as simple as copying all files over to the new location.
I changed only 2 parameters in the /var/lib/jenkins/config.xml
file. These are from:
<workspaceDir>$ITEM_ROOTDIR/workspace</workspaceDir>
<buildsDir>$ITEM_ROOTDIR/builds</buildsDir>
To...
<workspaceDir>/wd-red1/jenkins_workspace/$ITEM_FULLNAME</workspaceDir>
<buildsDir>/wd-red1/jenkins_builds/$ITEM_FULL_NAME</buildsDir>
Then I have copied all files from /var/lib/jenkins/workspace
and /var/lib/jenkins/jobs
respectively to the locations above. All went well except for the job build histories.
My question is: Can I somehow import the job build history too?
jenkins
Did all sub folders under /var/lib/jenkins/jobs get copied over correctly ?
– ben5556
Nov 12 '18 at 22:37
Yeah, I checked that. I usedcp -r * /wd-red1/jenkins_builds/
to copy those over.
– Scorpio
Nov 13 '18 at 6:16
add a comment |
I am currently running Jenkins ver. 2.121.2. I am in charge to migrate all jenkins builds and workspace to a new location since we have many projects filling our system's SSD. And we decided to have the workspace and build location to be on a HDD. Migrating all the data wasn't hard but the unexpected side effect is, that all jenkins jobs have lost their build history. I thought it would be as simple as copying all files over to the new location.
I changed only 2 parameters in the /var/lib/jenkins/config.xml
file. These are from:
<workspaceDir>$ITEM_ROOTDIR/workspace</workspaceDir>
<buildsDir>$ITEM_ROOTDIR/builds</buildsDir>
To...
<workspaceDir>/wd-red1/jenkins_workspace/$ITEM_FULLNAME</workspaceDir>
<buildsDir>/wd-red1/jenkins_builds/$ITEM_FULL_NAME</buildsDir>
Then I have copied all files from /var/lib/jenkins/workspace
and /var/lib/jenkins/jobs
respectively to the locations above. All went well except for the job build histories.
My question is: Can I somehow import the job build history too?
jenkins
I am currently running Jenkins ver. 2.121.2. I am in charge to migrate all jenkins builds and workspace to a new location since we have many projects filling our system's SSD. And we decided to have the workspace and build location to be on a HDD. Migrating all the data wasn't hard but the unexpected side effect is, that all jenkins jobs have lost their build history. I thought it would be as simple as copying all files over to the new location.
I changed only 2 parameters in the /var/lib/jenkins/config.xml
file. These are from:
<workspaceDir>$ITEM_ROOTDIR/workspace</workspaceDir>
<buildsDir>$ITEM_ROOTDIR/builds</buildsDir>
To...
<workspaceDir>/wd-red1/jenkins_workspace/$ITEM_FULLNAME</workspaceDir>
<buildsDir>/wd-red1/jenkins_builds/$ITEM_FULL_NAME</buildsDir>
Then I have copied all files from /var/lib/jenkins/workspace
and /var/lib/jenkins/jobs
respectively to the locations above. All went well except for the job build histories.
My question is: Can I somehow import the job build history too?
jenkins
jenkins
edited Nov 13 '18 at 6:32
Scorpio
asked Nov 12 '18 at 18:03
ScorpioScorpio
33
33
Did all sub folders under /var/lib/jenkins/jobs get copied over correctly ?
– ben5556
Nov 12 '18 at 22:37
Yeah, I checked that. I usedcp -r * /wd-red1/jenkins_builds/
to copy those over.
– Scorpio
Nov 13 '18 at 6:16
add a comment |
Did all sub folders under /var/lib/jenkins/jobs get copied over correctly ?
– ben5556
Nov 12 '18 at 22:37
Yeah, I checked that. I usedcp -r * /wd-red1/jenkins_builds/
to copy those over.
– Scorpio
Nov 13 '18 at 6:16
Did all sub folders under /var/lib/jenkins/jobs get copied over correctly ?
– ben5556
Nov 12 '18 at 22:37
Did all sub folders under /var/lib/jenkins/jobs get copied over correctly ?
– ben5556
Nov 12 '18 at 22:37
Yeah, I checked that. I used
cp -r * /wd-red1/jenkins_builds/
to copy those over.– Scorpio
Nov 13 '18 at 6:16
Yeah, I checked that. I used
cp -r * /wd-red1/jenkins_builds/
to copy those over.– Scorpio
Nov 13 '18 at 6:16
add a comment |
1 Answer
1
active
oldest
votes
If your old jenkins instance is still running, install "thinbackup" and take a full backup. Copying the backup into the new server and restoring the backup will give you all the configurations as it is in old server. I tried this someday back and it worked liked a charm.
Note : Thinbackup plug in supports both backup and restore.
That did not work. All build history is still lost. I have reverted the setting inconfig.xml
to get all the build history, then I backed everything up (waited for some time until I saw the backup location stopped growing in size), then I shut down jenkins, changed the workspace+build location, started jenkins up and restored the backup. Everything is still the same :/ I would need the build history files themselves.
– Scorpio
Nov 13 '18 at 7:06
I believe you wouldn't have checked "Backup build results" in thin backup setting. To be on the safer side, click all the checkbox in thinbackup settings and take a backup
– Prasa2166
Nov 13 '18 at 7:37
I did that too, however some checkboxes according to their labels wouldn't backup what may be the build history and as such I did not select those. These are "Backup only builds marked to keep", "Backup additional files", "Move old backups to ZIP files" and others like that.
– Scorpio
Nov 13 '18 at 8:03
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53267714%2fjenkins-job-build-history-lost-after-migrating-workspace-to-a-new-hard-drive%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If your old jenkins instance is still running, install "thinbackup" and take a full backup. Copying the backup into the new server and restoring the backup will give you all the configurations as it is in old server. I tried this someday back and it worked liked a charm.
Note : Thinbackup plug in supports both backup and restore.
That did not work. All build history is still lost. I have reverted the setting inconfig.xml
to get all the build history, then I backed everything up (waited for some time until I saw the backup location stopped growing in size), then I shut down jenkins, changed the workspace+build location, started jenkins up and restored the backup. Everything is still the same :/ I would need the build history files themselves.
– Scorpio
Nov 13 '18 at 7:06
I believe you wouldn't have checked "Backup build results" in thin backup setting. To be on the safer side, click all the checkbox in thinbackup settings and take a backup
– Prasa2166
Nov 13 '18 at 7:37
I did that too, however some checkboxes according to their labels wouldn't backup what may be the build history and as such I did not select those. These are "Backup only builds marked to keep", "Backup additional files", "Move old backups to ZIP files" and others like that.
– Scorpio
Nov 13 '18 at 8:03
add a comment |
If your old jenkins instance is still running, install "thinbackup" and take a full backup. Copying the backup into the new server and restoring the backup will give you all the configurations as it is in old server. I tried this someday back and it worked liked a charm.
Note : Thinbackup plug in supports both backup and restore.
That did not work. All build history is still lost. I have reverted the setting inconfig.xml
to get all the build history, then I backed everything up (waited for some time until I saw the backup location stopped growing in size), then I shut down jenkins, changed the workspace+build location, started jenkins up and restored the backup. Everything is still the same :/ I would need the build history files themselves.
– Scorpio
Nov 13 '18 at 7:06
I believe you wouldn't have checked "Backup build results" in thin backup setting. To be on the safer side, click all the checkbox in thinbackup settings and take a backup
– Prasa2166
Nov 13 '18 at 7:37
I did that too, however some checkboxes according to their labels wouldn't backup what may be the build history and as such I did not select those. These are "Backup only builds marked to keep", "Backup additional files", "Move old backups to ZIP files" and others like that.
– Scorpio
Nov 13 '18 at 8:03
add a comment |
If your old jenkins instance is still running, install "thinbackup" and take a full backup. Copying the backup into the new server and restoring the backup will give you all the configurations as it is in old server. I tried this someday back and it worked liked a charm.
Note : Thinbackup plug in supports both backup and restore.
If your old jenkins instance is still running, install "thinbackup" and take a full backup. Copying the backup into the new server and restoring the backup will give you all the configurations as it is in old server. I tried this someday back and it worked liked a charm.
Note : Thinbackup plug in supports both backup and restore.
answered Nov 13 '18 at 2:42
Prasa2166Prasa2166
84
84
That did not work. All build history is still lost. I have reverted the setting inconfig.xml
to get all the build history, then I backed everything up (waited for some time until I saw the backup location stopped growing in size), then I shut down jenkins, changed the workspace+build location, started jenkins up and restored the backup. Everything is still the same :/ I would need the build history files themselves.
– Scorpio
Nov 13 '18 at 7:06
I believe you wouldn't have checked "Backup build results" in thin backup setting. To be on the safer side, click all the checkbox in thinbackup settings and take a backup
– Prasa2166
Nov 13 '18 at 7:37
I did that too, however some checkboxes according to their labels wouldn't backup what may be the build history and as such I did not select those. These are "Backup only builds marked to keep", "Backup additional files", "Move old backups to ZIP files" and others like that.
– Scorpio
Nov 13 '18 at 8:03
add a comment |
That did not work. All build history is still lost. I have reverted the setting inconfig.xml
to get all the build history, then I backed everything up (waited for some time until I saw the backup location stopped growing in size), then I shut down jenkins, changed the workspace+build location, started jenkins up and restored the backup. Everything is still the same :/ I would need the build history files themselves.
– Scorpio
Nov 13 '18 at 7:06
I believe you wouldn't have checked "Backup build results" in thin backup setting. To be on the safer side, click all the checkbox in thinbackup settings and take a backup
– Prasa2166
Nov 13 '18 at 7:37
I did that too, however some checkboxes according to their labels wouldn't backup what may be the build history and as such I did not select those. These are "Backup only builds marked to keep", "Backup additional files", "Move old backups to ZIP files" and others like that.
– Scorpio
Nov 13 '18 at 8:03
That did not work. All build history is still lost. I have reverted the setting in
config.xml
to get all the build history, then I backed everything up (waited for some time until I saw the backup location stopped growing in size), then I shut down jenkins, changed the workspace+build location, started jenkins up and restored the backup. Everything is still the same :/ I would need the build history files themselves.– Scorpio
Nov 13 '18 at 7:06
That did not work. All build history is still lost. I have reverted the setting in
config.xml
to get all the build history, then I backed everything up (waited for some time until I saw the backup location stopped growing in size), then I shut down jenkins, changed the workspace+build location, started jenkins up and restored the backup. Everything is still the same :/ I would need the build history files themselves.– Scorpio
Nov 13 '18 at 7:06
I believe you wouldn't have checked "Backup build results" in thin backup setting. To be on the safer side, click all the checkbox in thinbackup settings and take a backup
– Prasa2166
Nov 13 '18 at 7:37
I believe you wouldn't have checked "Backup build results" in thin backup setting. To be on the safer side, click all the checkbox in thinbackup settings and take a backup
– Prasa2166
Nov 13 '18 at 7:37
I did that too, however some checkboxes according to their labels wouldn't backup what may be the build history and as such I did not select those. These are "Backup only builds marked to keep", "Backup additional files", "Move old backups to ZIP files" and others like that.
– Scorpio
Nov 13 '18 at 8:03
I did that too, however some checkboxes according to their labels wouldn't backup what may be the build history and as such I did not select those. These are "Backup only builds marked to keep", "Backup additional files", "Move old backups to ZIP files" and others like that.
– Scorpio
Nov 13 '18 at 8:03
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53267714%2fjenkins-job-build-history-lost-after-migrating-workspace-to-a-new-hard-drive%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did all sub folders under /var/lib/jenkins/jobs get copied over correctly ?
– ben5556
Nov 12 '18 at 22:37
Yeah, I checked that. I used
cp -r * /wd-red1/jenkins_builds/
to copy those over.– Scorpio
Nov 13 '18 at 6:16