Repopulating PostgreSQL Database with Data Directory from Another DataBase InstancePostgreSQL: Trouble...

Are paving bricks differently sized for sand bedding vs mortar bedding?

How can I block email signup overlays or javascript popups in Safari?

Are the IPv6 address space and IPv4 address space completely disjoint?

The IT department bottlenecks progress. How should I handle this?

Why can Carol Danvers change her suit colours in the first place?

lightning-datatable row number error

Travelling outside the UK without a passport

Non-trope happy ending?

What does chmod -u do?

Closed-form expression for certain product

It grows, but water kills it

What does "Scientists rise up against statistical significance" mean? (Comment in Nature)

Terse Method to Swap Lowest for Highest?

Can I sign legal documents with a smiley face?

Why did the EU agree to delay the Brexit deadline?

Is this toilet slogan correct usage of the English language?

What was the exact wording from Ivanhoe of this advice on how to free yourself from slavery?

Removing files under particular conditions (number of files, file age)

Delivering sarcasm

Why electric field inside a cavity of a non-conducting sphere not zero?

Pre-mixing cryogenic fuels and using only one fuel tank

Which one is correct as adjective “protruding” or “protruded”?

How do you make your own symbol when Detexify fails?

Why does the Sun have different day lengths, but not the gas giants?



Repopulating PostgreSQL Database with Data Directory from Another DataBase Instance


PostgreSQL: Trouble accessing another server's Data via NFSCopy Postgres databases with indexes between instancesHow to Restore Postgresql Cluster from data directoryMultiple database directories with postgresqlPostgreSQL: Restoring 1 file from a directory format dumpPostgreSQL migrating from 9.2 to 9.5 with data dir on different volumeNew install and admin establishing postgresql passwordUpgrading PostgreSQL from 9.6.6 to 10.1Can we reconstruct/reset a broken Postgresql data directory without losing data?postgresql configuring wal_archive directory













0















I have had to delete PostgreSQL for an issue and reinstall it, however before uninstalling I did not execute the command pg_dump. I still have the data directory from this instance. After reinstalling PostgreSQL, I receive all the same tables and schemas from my prior database, but not the same data. The data directories are two separate, but I want to combine the previous data directory into the new one. How would I go about such a process, if possible?










share|improve this question














bumped to the homepage by Community 5 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    I have had to delete PostgreSQL for an issue and reinstall it, however before uninstalling I did not execute the command pg_dump. I still have the data directory from this instance. After reinstalling PostgreSQL, I receive all the same tables and schemas from my prior database, but not the same data. The data directories are two separate, but I want to combine the previous data directory into the new one. How would I go about such a process, if possible?










    share|improve this question














    bumped to the homepage by Community 5 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      I have had to delete PostgreSQL for an issue and reinstall it, however before uninstalling I did not execute the command pg_dump. I still have the data directory from this instance. After reinstalling PostgreSQL, I receive all the same tables and schemas from my prior database, but not the same data. The data directories are two separate, but I want to combine the previous data directory into the new one. How would I go about such a process, if possible?










      share|improve this question














      I have had to delete PostgreSQL for an issue and reinstall it, however before uninstalling I did not execute the command pg_dump. I still have the data directory from this instance. After reinstalling PostgreSQL, I receive all the same tables and schemas from my prior database, but not the same data. The data directories are two separate, but I want to combine the previous data directory into the new one. How would I go about such a process, if possible?







      postgresql






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 27 '16 at 5:13









      Tetraphenom Tetraphenom

      11




      11





      bumped to the homepage by Community 5 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 5 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Assumptions



          I'm assuming you have two instances each one with a different data directory but with the same schema for the same version of postgres installed.
          I'm also assuming when the server starts is using your newly created, possibly empty, instance



          What to do



          You should try to start a new instance of the server pointing to your backup data directory...

          Somenthing like



          pg_ctl -D /path/to/backup/dir -l /path/to/log start -o "-p 5433"


          If this works, your backup instance is running on port 5433.

          Check if everything is in place and the data is consistent.



          If so then you could simply make arrangements for your server to always start pointing to your backup directory and safely delete your newly created data directory.






          share|improve this answer
























          • I appreciate your advice, and I apologize for the late response. What had happened was there was an issue with my first installation of postgresql, and I was in a bind; I uninstalled (left the data directory alone and did not perform a dump) and reinstalled with postgres.app. I have not tried your method yet, but it seems to me that in your assumption, you assume that I still have old instance available; to which I unfortunately do not. Please do tell me if I am wrong.

            – Tetraphenom
            Jun 29 '16 at 5:39











          • For this you just need the old data directory. Whether your new installed postgresql is running an instance or not is not important because you will manually start a new one in a different port (5433) with a different data directory (your old data directory) which is supposed to be valid because it was created with the same version of postgresql in a previous install. Try the command and see if that works. Please make a backup of your backup just in case ;)

            – cachique
            Jun 29 '16 at 13:36











          • When using this command, I get invalid option --1

            – Tetraphenom
            Jul 5 '16 at 15:06











          • When dropping the /path/to/log, I get the server started -- however, when trying to access using pgadmin III I cannot connect to server

            – Tetraphenom
            Jul 5 '16 at 15:39











          • The error is : `psql: could not connect to server: No such file or directory. Is the server running locally and accepting conections on Unix domain socket "/tmp/.s.PGSQL.5433"?

            – Tetraphenom
            Jul 5 '16 at 16:21











          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
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f142314%2frepopulating-postgresql-database-with-data-directory-from-another-database-insta%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









          0














          Assumptions



          I'm assuming you have two instances each one with a different data directory but with the same schema for the same version of postgres installed.
          I'm also assuming when the server starts is using your newly created, possibly empty, instance



          What to do



          You should try to start a new instance of the server pointing to your backup data directory...

          Somenthing like



          pg_ctl -D /path/to/backup/dir -l /path/to/log start -o "-p 5433"


          If this works, your backup instance is running on port 5433.

          Check if everything is in place and the data is consistent.



          If so then you could simply make arrangements for your server to always start pointing to your backup directory and safely delete your newly created data directory.






          share|improve this answer
























          • I appreciate your advice, and I apologize for the late response. What had happened was there was an issue with my first installation of postgresql, and I was in a bind; I uninstalled (left the data directory alone and did not perform a dump) and reinstalled with postgres.app. I have not tried your method yet, but it seems to me that in your assumption, you assume that I still have old instance available; to which I unfortunately do not. Please do tell me if I am wrong.

            – Tetraphenom
            Jun 29 '16 at 5:39











          • For this you just need the old data directory. Whether your new installed postgresql is running an instance or not is not important because you will manually start a new one in a different port (5433) with a different data directory (your old data directory) which is supposed to be valid because it was created with the same version of postgresql in a previous install. Try the command and see if that works. Please make a backup of your backup just in case ;)

            – cachique
            Jun 29 '16 at 13:36











          • When using this command, I get invalid option --1

            – Tetraphenom
            Jul 5 '16 at 15:06











          • When dropping the /path/to/log, I get the server started -- however, when trying to access using pgadmin III I cannot connect to server

            – Tetraphenom
            Jul 5 '16 at 15:39











          • The error is : `psql: could not connect to server: No such file or directory. Is the server running locally and accepting conections on Unix domain socket "/tmp/.s.PGSQL.5433"?

            – Tetraphenom
            Jul 5 '16 at 16:21
















          0














          Assumptions



          I'm assuming you have two instances each one with a different data directory but with the same schema for the same version of postgres installed.
          I'm also assuming when the server starts is using your newly created, possibly empty, instance



          What to do



          You should try to start a new instance of the server pointing to your backup data directory...

          Somenthing like



          pg_ctl -D /path/to/backup/dir -l /path/to/log start -o "-p 5433"


          If this works, your backup instance is running on port 5433.

          Check if everything is in place and the data is consistent.



          If so then you could simply make arrangements for your server to always start pointing to your backup directory and safely delete your newly created data directory.






          share|improve this answer
























          • I appreciate your advice, and I apologize for the late response. What had happened was there was an issue with my first installation of postgresql, and I was in a bind; I uninstalled (left the data directory alone and did not perform a dump) and reinstalled with postgres.app. I have not tried your method yet, but it seems to me that in your assumption, you assume that I still have old instance available; to which I unfortunately do not. Please do tell me if I am wrong.

            – Tetraphenom
            Jun 29 '16 at 5:39











          • For this you just need the old data directory. Whether your new installed postgresql is running an instance or not is not important because you will manually start a new one in a different port (5433) with a different data directory (your old data directory) which is supposed to be valid because it was created with the same version of postgresql in a previous install. Try the command and see if that works. Please make a backup of your backup just in case ;)

            – cachique
            Jun 29 '16 at 13:36











          • When using this command, I get invalid option --1

            – Tetraphenom
            Jul 5 '16 at 15:06











          • When dropping the /path/to/log, I get the server started -- however, when trying to access using pgadmin III I cannot connect to server

            – Tetraphenom
            Jul 5 '16 at 15:39











          • The error is : `psql: could not connect to server: No such file or directory. Is the server running locally and accepting conections on Unix domain socket "/tmp/.s.PGSQL.5433"?

            – Tetraphenom
            Jul 5 '16 at 16:21














          0












          0








          0







          Assumptions



          I'm assuming you have two instances each one with a different data directory but with the same schema for the same version of postgres installed.
          I'm also assuming when the server starts is using your newly created, possibly empty, instance



          What to do



          You should try to start a new instance of the server pointing to your backup data directory...

          Somenthing like



          pg_ctl -D /path/to/backup/dir -l /path/to/log start -o "-p 5433"


          If this works, your backup instance is running on port 5433.

          Check if everything is in place and the data is consistent.



          If so then you could simply make arrangements for your server to always start pointing to your backup directory and safely delete your newly created data directory.






          share|improve this answer













          Assumptions



          I'm assuming you have two instances each one with a different data directory but with the same schema for the same version of postgres installed.
          I'm also assuming when the server starts is using your newly created, possibly empty, instance



          What to do



          You should try to start a new instance of the server pointing to your backup data directory...

          Somenthing like



          pg_ctl -D /path/to/backup/dir -l /path/to/log start -o "-p 5433"


          If this works, your backup instance is running on port 5433.

          Check if everything is in place and the data is consistent.



          If so then you could simply make arrangements for your server to always start pointing to your backup directory and safely delete your newly created data directory.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 27 '16 at 19:13









          cachiquecachique

          20115




          20115













          • I appreciate your advice, and I apologize for the late response. What had happened was there was an issue with my first installation of postgresql, and I was in a bind; I uninstalled (left the data directory alone and did not perform a dump) and reinstalled with postgres.app. I have not tried your method yet, but it seems to me that in your assumption, you assume that I still have old instance available; to which I unfortunately do not. Please do tell me if I am wrong.

            – Tetraphenom
            Jun 29 '16 at 5:39











          • For this you just need the old data directory. Whether your new installed postgresql is running an instance or not is not important because you will manually start a new one in a different port (5433) with a different data directory (your old data directory) which is supposed to be valid because it was created with the same version of postgresql in a previous install. Try the command and see if that works. Please make a backup of your backup just in case ;)

            – cachique
            Jun 29 '16 at 13:36











          • When using this command, I get invalid option --1

            – Tetraphenom
            Jul 5 '16 at 15:06











          • When dropping the /path/to/log, I get the server started -- however, when trying to access using pgadmin III I cannot connect to server

            – Tetraphenom
            Jul 5 '16 at 15:39











          • The error is : `psql: could not connect to server: No such file or directory. Is the server running locally and accepting conections on Unix domain socket "/tmp/.s.PGSQL.5433"?

            – Tetraphenom
            Jul 5 '16 at 16:21



















          • I appreciate your advice, and I apologize for the late response. What had happened was there was an issue with my first installation of postgresql, and I was in a bind; I uninstalled (left the data directory alone and did not perform a dump) and reinstalled with postgres.app. I have not tried your method yet, but it seems to me that in your assumption, you assume that I still have old instance available; to which I unfortunately do not. Please do tell me if I am wrong.

            – Tetraphenom
            Jun 29 '16 at 5:39











          • For this you just need the old data directory. Whether your new installed postgresql is running an instance or not is not important because you will manually start a new one in a different port (5433) with a different data directory (your old data directory) which is supposed to be valid because it was created with the same version of postgresql in a previous install. Try the command and see if that works. Please make a backup of your backup just in case ;)

            – cachique
            Jun 29 '16 at 13:36











          • When using this command, I get invalid option --1

            – Tetraphenom
            Jul 5 '16 at 15:06











          • When dropping the /path/to/log, I get the server started -- however, when trying to access using pgadmin III I cannot connect to server

            – Tetraphenom
            Jul 5 '16 at 15:39











          • The error is : `psql: could not connect to server: No such file or directory. Is the server running locally and accepting conections on Unix domain socket "/tmp/.s.PGSQL.5433"?

            – Tetraphenom
            Jul 5 '16 at 16:21

















          I appreciate your advice, and I apologize for the late response. What had happened was there was an issue with my first installation of postgresql, and I was in a bind; I uninstalled (left the data directory alone and did not perform a dump) and reinstalled with postgres.app. I have not tried your method yet, but it seems to me that in your assumption, you assume that I still have old instance available; to which I unfortunately do not. Please do tell me if I am wrong.

          – Tetraphenom
          Jun 29 '16 at 5:39





          I appreciate your advice, and I apologize for the late response. What had happened was there was an issue with my first installation of postgresql, and I was in a bind; I uninstalled (left the data directory alone and did not perform a dump) and reinstalled with postgres.app. I have not tried your method yet, but it seems to me that in your assumption, you assume that I still have old instance available; to which I unfortunately do not. Please do tell me if I am wrong.

          – Tetraphenom
          Jun 29 '16 at 5:39













          For this you just need the old data directory. Whether your new installed postgresql is running an instance or not is not important because you will manually start a new one in a different port (5433) with a different data directory (your old data directory) which is supposed to be valid because it was created with the same version of postgresql in a previous install. Try the command and see if that works. Please make a backup of your backup just in case ;)

          – cachique
          Jun 29 '16 at 13:36





          For this you just need the old data directory. Whether your new installed postgresql is running an instance or not is not important because you will manually start a new one in a different port (5433) with a different data directory (your old data directory) which is supposed to be valid because it was created with the same version of postgresql in a previous install. Try the command and see if that works. Please make a backup of your backup just in case ;)

          – cachique
          Jun 29 '16 at 13:36













          When using this command, I get invalid option --1

          – Tetraphenom
          Jul 5 '16 at 15:06





          When using this command, I get invalid option --1

          – Tetraphenom
          Jul 5 '16 at 15:06













          When dropping the /path/to/log, I get the server started -- however, when trying to access using pgadmin III I cannot connect to server

          – Tetraphenom
          Jul 5 '16 at 15:39





          When dropping the /path/to/log, I get the server started -- however, when trying to access using pgadmin III I cannot connect to server

          – Tetraphenom
          Jul 5 '16 at 15:39













          The error is : `psql: could not connect to server: No such file or directory. Is the server running locally and accepting conections on Unix domain socket "/tmp/.s.PGSQL.5433"?

          – Tetraphenom
          Jul 5 '16 at 16:21





          The error is : `psql: could not connect to server: No such file or directory. Is the server running locally and accepting conections on Unix domain socket "/tmp/.s.PGSQL.5433"?

          – Tetraphenom
          Jul 5 '16 at 16:21


















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f142314%2frepopulating-postgresql-database-with-data-directory-from-another-database-insta%23new-answer', 'question_page');
          }
          );

          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







          Popular posts from this blog

          Parapolítica Índice Antecedentes El escándalo Proceso judicial Consecuencias Véase...

          How to remove border from elements in the last row?Targeting flex items on the last rowHow to vertically wrap...

          Tecnologías entrañables Índice Antecedentes Desarrollo Tecnologías Entrañables en la...