6 Replies Latest reply on Mar 26, 2014 8:57 AM by pcrownov

    Restore Postgres Database via dmp file help

    pcrownov

      Hey,

          I am trying to restore a postgres databse using a .dmp file. I have been able to successfully recreate the database a few different ways but am having issues getting Jive to recognize the new database. After every database restore, the Jive app will always 404 on the main page and the logs are outputting a lot of "BeanCreationException" after an initial "ERROR context.ContextLoader - Context initialization failed".

       

      I have tried to initialize the DB first and then install a new instance of Jive which is pointed to that DB; as well as set everything up and then override the DB with the dump data and both have resulted in the same errors.

       

      Am I missing a step somewhere after restoring the data to make Jive accept the new database/state of the data? Any help would be greatly appreciated.

       

      Jive version 6.0.0.2

      Pgsql version: 9.3

       

      restore method:

      sudo su postgres

      dropdb core;

      createdb core;

      pg_restore -j <number of cores on machine> -Fc -O -d core <dump file>

      Grant all permissions on db core to user core to make sure data is accessible

      change owner of core from postgres back to core(since it was remade)

      change the following values in the restored database to avoid sending emails to prod users as well as other basic settings

           - update jiveuser set email = username || 'discard@localhost';

          - update jiveproperty set propvalue = 'http://127.0.0.1:8080' where name = 'jiveURL';

          - delete from jiveplugin;

          - update jiveproperty set propvalue = 'nomail' where name = 'checkmail.host' or name = 'mail.smtp.host';

          - update jiveproperty set propvalue = 'false' where name = 'cache.clustering.enabled';

          - delete from jiveproperty where name like 'jive.cluster.jgroup.servers.address%';

          - update jiveproperty set propvalue = 'false' where name = 'jive.admin.cache.preset';

          - delete from jiveproperty where name like 'jive.cache.voldemort.servers.%';

          - delete from jiveproperty where name like '%storage%';

          - insert into jiveproperty (name, propvalue) values ('jive.storageprovider.cache.enabled', 'true');

          - update jiveuser set passwordhash = '392c80e00ab4d948424e091048e27566c2de2a4a9820ac2d44d9733d88af3d57', creationdate = '1282954568204' where userid = 1;

       

      then after the restore either the previously installed, or post-restore installed Jive app in either case will 404.  Do I need to maybe change a few other settings?

       

      Thanks

       

      -Patrick

        • Re: Restore Postgres Database via dmp file help
          whoiskevin

          Looks like you are trying to reset the storage provider?  That could be the problem you are having.  The database is going to point to the storage provider so I would either it an equivalent path in your new environment instead of just wiping all those settings out.  Probably need more specifics on the first part of the failures to really diagnose something like this.

            • Re: Restore Postgres Database via dmp file help
              pcrownov

              Sorry, I am not sure what you mean by storage provider in this sense, let me give a better explanation.

               

              I have a local instance of everything on a VM that I am using for data restoration purposes i.e. someone deletes a page on accident (somehow this has actually happened...) and I need to restore the database from a point before they deleted the space. We requested the Database dump file and I have it available but I need to get the data into the database and accessible by Jive in order to actually access the available page. To do this, the best solution I could come up with was to restore the entire database dump into my local environment. After using pg_restore to re-create the database and data (I verified that it exists), I tried to reconnect my instance of Jive (still local) to it at which point Jive kept throwing a 404. I have tried 3 different ways of handling this.

              1. re-run the jive setup after I restore the database

              2. only install jive after restoring the database (somewhat the same as 1)

              3. restoring the database into the same system that jive is currently using

               

              all 3 scenarios resulted in the same result, the 404 page when I go to 127.0.0.1

               

              the only logs I found, were the sbs.log files and they were riddled with the  "BeanCreationException" after an initial "ERROR context.ContextLoader - Context initialization failed" that I mentioned above. I hope that this explains better what I am trying to do while above is more how I actually went about doing it.

               

              Thanks

              -Patrick

            • Re: Restore Postgres Database via dmp file help
              pcrownov

              According to Jive, this is unsupported. They provide the DB dumps only in order for the user to query the raw data, not use it to create a new instance based off of it. I am curious how they handle if the DB on prod fails and needs to be restored, but until I have time to play with this more or someone provides a better solution, I will be playing around in the schema trying to pull out the deleted page. Jive 6.0 Community Administrator Documentation

               

              Thanks