Deleting old files in /var/lib/postgresql/9.x/main after changing postgresql data_directory
Very recently, I changed the data_directory of posgresql (9.3.10) to point to a new data disk I recently added to my VM (Ubuntu 14.04 OS). All the old data has been transferred to this new disk as well.
Prior to this shift, the data_directory was residing in the disk that had the OS installed too. This was a digestible arrangement initially, but ultimately the data_directory almost came to fill the entire 30GB space available. Thus I made the shift.
My question is: can I delete the contents of the old var/lib/postgresql/9.x/main/ folder now that data_directory is entirely pointing to a new location?
The old files are still intact, taking a ton of space, and the only reason I haven't deleted them is because other elements in the postgresql config (or some daemon scripts) might be referring to this folder structure somehow. I'm not sure. Someone with experience can perhaps help out here.
postgresql postgresql-9.3
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
Very recently, I changed the data_directory of posgresql (9.3.10) to point to a new data disk I recently added to my VM (Ubuntu 14.04 OS). All the old data has been transferred to this new disk as well.
Prior to this shift, the data_directory was residing in the disk that had the OS installed too. This was a digestible arrangement initially, but ultimately the data_directory almost came to fill the entire 30GB space available. Thus I made the shift.
My question is: can I delete the contents of the old var/lib/postgresql/9.x/main/ folder now that data_directory is entirely pointing to a new location?
The old files are still intact, taking a ton of space, and the only reason I haven't deleted them is because other elements in the postgresql config (or some daemon scripts) might be referring to this folder structure somehow. I'm not sure. Someone with experience can perhaps help out here.
postgresql postgresql-9.3
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
Very recently, I changed the data_directory of posgresql (9.3.10) to point to a new data disk I recently added to my VM (Ubuntu 14.04 OS). All the old data has been transferred to this new disk as well.
Prior to this shift, the data_directory was residing in the disk that had the OS installed too. This was a digestible arrangement initially, but ultimately the data_directory almost came to fill the entire 30GB space available. Thus I made the shift.
My question is: can I delete the contents of the old var/lib/postgresql/9.x/main/ folder now that data_directory is entirely pointing to a new location?
The old files are still intact, taking a ton of space, and the only reason I haven't deleted them is because other elements in the postgresql config (or some daemon scripts) might be referring to this folder structure somehow. I'm not sure. Someone with experience can perhaps help out here.
postgresql postgresql-9.3
Very recently, I changed the data_directory of posgresql (9.3.10) to point to a new data disk I recently added to my VM (Ubuntu 14.04 OS). All the old data has been transferred to this new disk as well.
Prior to this shift, the data_directory was residing in the disk that had the OS installed too. This was a digestible arrangement initially, but ultimately the data_directory almost came to fill the entire 30GB space available. Thus I made the shift.
My question is: can I delete the contents of the old var/lib/postgresql/9.x/main/ folder now that data_directory is entirely pointing to a new location?
The old files are still intact, taking a ton of space, and the only reason I haven't deleted them is because other elements in the postgresql config (or some daemon scripts) might be referring to this folder structure somehow. I'm not sure. Someone with experience can perhaps help out here.
postgresql postgresql-9.3
postgresql postgresql-9.3
asked Mar 21 '17 at 11:59
Hassan BaigHassan Baig
4871824
4871824
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There shouldn't be any references as all the scripts/utils/etc use the data directory environment variable.
the only place I would look is in the new configuration file - take a look you don't have any includes that point to the old folder (not sure at what version they added this option.)
BTW, it's always a good practice to rename (mv dir dir_bck) the folder for a week to see you really don't have anything trying to access there.
(you shouldn't anyway as it's stale data...)
Regards,
- Jony
Sounds good, I was also thinking even if there are any dependencies that I ultimately stumble upon, one thing that ought to be absolutely safe is getting rid of the data inside the old/basefolder. That immediately frees up several GBs for me, and even if I discover dependencies later, I'd at least have kept the old directory organization intact.
– Hassan Baig
Mar 21 '17 at 15:20
Just checked, don't have any include statements that refer to the older files
– Hassan Baig
Mar 21 '17 at 15:24
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2fdba.stackexchange.com%2fquestions%2f167726%2fdeleting-old-files-in-var-lib-postgresql-9-x-main-after-changing-postgresql-dat%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
There shouldn't be any references as all the scripts/utils/etc use the data directory environment variable.
the only place I would look is in the new configuration file - take a look you don't have any includes that point to the old folder (not sure at what version they added this option.)
BTW, it's always a good practice to rename (mv dir dir_bck) the folder for a week to see you really don't have anything trying to access there.
(you shouldn't anyway as it's stale data...)
Regards,
- Jony
Sounds good, I was also thinking even if there are any dependencies that I ultimately stumble upon, one thing that ought to be absolutely safe is getting rid of the data inside the old/basefolder. That immediately frees up several GBs for me, and even if I discover dependencies later, I'd at least have kept the old directory organization intact.
– Hassan Baig
Mar 21 '17 at 15:20
Just checked, don't have any include statements that refer to the older files
– Hassan Baig
Mar 21 '17 at 15:24
add a comment |
There shouldn't be any references as all the scripts/utils/etc use the data directory environment variable.
the only place I would look is in the new configuration file - take a look you don't have any includes that point to the old folder (not sure at what version they added this option.)
BTW, it's always a good practice to rename (mv dir dir_bck) the folder for a week to see you really don't have anything trying to access there.
(you shouldn't anyway as it's stale data...)
Regards,
- Jony
Sounds good, I was also thinking even if there are any dependencies that I ultimately stumble upon, one thing that ought to be absolutely safe is getting rid of the data inside the old/basefolder. That immediately frees up several GBs for me, and even if I discover dependencies later, I'd at least have kept the old directory organization intact.
– Hassan Baig
Mar 21 '17 at 15:20
Just checked, don't have any include statements that refer to the older files
– Hassan Baig
Mar 21 '17 at 15:24
add a comment |
There shouldn't be any references as all the scripts/utils/etc use the data directory environment variable.
the only place I would look is in the new configuration file - take a look you don't have any includes that point to the old folder (not sure at what version they added this option.)
BTW, it's always a good practice to rename (mv dir dir_bck) the folder for a week to see you really don't have anything trying to access there.
(you shouldn't anyway as it's stale data...)
Regards,
- Jony
There shouldn't be any references as all the scripts/utils/etc use the data directory environment variable.
the only place I would look is in the new configuration file - take a look you don't have any includes that point to the old folder (not sure at what version they added this option.)
BTW, it's always a good practice to rename (mv dir dir_bck) the folder for a week to see you really don't have anything trying to access there.
(you shouldn't anyway as it's stale data...)
Regards,
- Jony
answered Mar 21 '17 at 15:14
cohenjocohenjo
77525
77525
Sounds good, I was also thinking even if there are any dependencies that I ultimately stumble upon, one thing that ought to be absolutely safe is getting rid of the data inside the old/basefolder. That immediately frees up several GBs for me, and even if I discover dependencies later, I'd at least have kept the old directory organization intact.
– Hassan Baig
Mar 21 '17 at 15:20
Just checked, don't have any include statements that refer to the older files
– Hassan Baig
Mar 21 '17 at 15:24
add a comment |
Sounds good, I was also thinking even if there are any dependencies that I ultimately stumble upon, one thing that ought to be absolutely safe is getting rid of the data inside the old/basefolder. That immediately frees up several GBs for me, and even if I discover dependencies later, I'd at least have kept the old directory organization intact.
– Hassan Baig
Mar 21 '17 at 15:20
Just checked, don't have any include statements that refer to the older files
– Hassan Baig
Mar 21 '17 at 15:24
Sounds good, I was also thinking even if there are any dependencies that I ultimately stumble upon, one thing that ought to be absolutely safe is getting rid of the data inside the old
/base folder. That immediately frees up several GBs for me, and even if I discover dependencies later, I'd at least have kept the old directory organization intact.– Hassan Baig
Mar 21 '17 at 15:20
Sounds good, I was also thinking even if there are any dependencies that I ultimately stumble upon, one thing that ought to be absolutely safe is getting rid of the data inside the old
/base folder. That immediately frees up several GBs for me, and even if I discover dependencies later, I'd at least have kept the old directory organization intact.– Hassan Baig
Mar 21 '17 at 15:20
Just checked, don't have any include statements that refer to the older files
– Hassan Baig
Mar 21 '17 at 15:24
Just checked, don't have any include statements that refer to the older files
– Hassan Baig
Mar 21 '17 at 15:24
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- 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%2fdba.stackexchange.com%2fquestions%2f167726%2fdeleting-old-files-in-var-lib-postgresql-9-x-main-after-changing-postgresql-dat%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