6 Replies Latest reply on Feb 12, 2014 1:26 PM by dstellern

    Migrate DB from OS X 10.6 > vsphere centos

    arig

      We're trying to migrate our data from a OS X 10.6 Server to a Vsphere Centos environment.

      We upgraded the OS X environment to version 12 and stepped through the conversion to postgreSQL.

       

      We've been following these instructions: SolarWinds Knowledge Base :: How to Migrate FrontBase DB from one Operating System (OS) to PostgreSQL DB to Another OS but neither the PGAdmin tool nor the PostgreSQL commands are giving us any populated output. When trying to use pg_dump we're recieving error "command not found" or "permission denied"

       

       

      Anyone with experience migrating away from OS X available to assist with more detailed instructions?

        • Re: Migrate DB from OS X 10.6 > vsphere centos
          daniel.sykora

          Hi,

          the original KB contains basic instructions only and will be replaced by KB with advanced instructions. Here is the draft, but you should hopefully find all details you need. Two important things to know: 1. you have to run commands as root (using sudo), 2. you have to run commands with full path to the program you want to run (e.g. PGadmin). See below.

           

          Most of these commands needs to be executed in command line, to open command line follow there instructions:

          • Windows - in Start → Run type cmd, it should be automatically opened with administrative privileges
          • Mac OS X -  Go to /Applications/Utilities and double-click on Terminal.
          • Linux (RPM installation) - when using graphical interface open the terminal from Applications/System tools menu or right clicking Desktop and hitting Open in Terminal (it can vary in different distributions), you can also connect remotely via SSH protocol as described in following section for Virtual Appliance
          • Virtual Appliance (Linux) - it's needed to connect to the server using SSH protocol, execute ssh username@server_ip_or_hostname command on Mac OS X and Linux or use PuTTY utility on Windows platform (credentials admin/admin)

          Please note that this KB uses standard installation directories for a reference. In case you installed WHD to a non standard directory replace C:\Progra~1\WebHelpDesk (Windows), /Library/WebHelpDesk (Mac OS C), /usr/local/webhelpdesk (Linux + VA) by the correct locations in all commands.

          1. Stop WHD application

            1. Windows
              • use Stop Web Help Desk shortcut from Start menu (Run as Administrator) items or execute following commands in command line

              • cd C:\Progra~1\WebHelpDesk
              • whd stop
            2. Mac OS X
              • Go to /Applications/WebHelpDesk and use Stop Web Help Desk icon from Start menu (Run as Administrator) items or execute following commands in terminal

              • cd /Library/WebHelpDesk
              • ./whd stop
            3. Linux (RPM installation)
              • cd /usr/local/webhelpdesk/
              • sudo ./whd stop
              • the previous command stops also embedded PostgreSQL database service, we need to start it to be able to run DB commands, type: sudo bin/pgsql/etc/rc.d/init.d/postgresql-9.2 start
            4. Virtual Appliance (Linux)
              • cd /usr/local/webhelpdesk/
              • sudo ./whd stop
              • the previous command stops also embedded PostgreSQL database service, we need to start it to be able to run DB commands, type: sudo bin/pgsql/etc/rc.d/init.d/postgresql-9.2 start
          2. Start WHD application

            1. Windows
              • use Start Web Help Desk shortcut from Start menu (Run as Administrator) items or execute following commands in command line

              • cd C:\Progra~1\WebHelpDesk
              • whd start
            2. Mac OS X
              • Go to /Applications/WebHelpDesk and use Start Web Help Desk icon from Start menu (Run as Administrator) items or execute following commands in terminal
              • cd /Library/WebHelpDesk
              • ./whd start
            3. Linux (RPM installation)
              • cd /usr/local/webhelpdesk/
              • sudo ./whd start
              • the previous command starts also embedded PostgreSQL database service (if not running)
            4. Virtual Appliance (Linux)
              • cd /usr/local/webhelpdesk/
              • sudo ./whd start
              • the previous command starts also embedded PostgreSQL database service (if not running)
          3. Stop the embedded PostgreSQL DB

            1. Windows (PostgreSQLServiceWHD - Help Desk PostgreSQL Embedded Database)
              • net stop PostgreSQLServiceWHD
            2. Mac OS X
              • cd /Library/WebHelpDesk
              • ./pg stop
            3. Linux (RPM installation)
              • cd /usr/local/webhelpdesk/
              • sudo bin/pgsql/etc/rc.d/init.d/postgresql-9.2 stop
            4. Virtual Appliance (Linux)
              • cd /usr/local/webhelpdesk/
              • sudo bin/pgsql/etc/rc.d/init.d/postgresql-9.2 stop
          4. Start the embedded PostgreSQL DB

            1. Windows
              • net start PostgreSQLServiceWHD
            2. Mac OS X
              • cd /Library/WebHelpDesk
              • ./pg start
            3. Linux (RPM installation)
              • cd /usr/local/webhelpdesk/
              • sudo bin/pgsql/etc/rc.d/init.d/postgresql-9.2 stop
            4. Virtual Appliance (Linux)
              • cd /usr/local/webhelpdesk/
              • sudo bin/pgsql/etc/rc.d/init.d/postgresql-9.2 stop
          5. Backup PostgreSQL embedded database (dump will be located at WHD_HOME_DIR)

            1. Windows
              • cd C:\Progra~1\WebHelpDesk
              • pgsql9\bin\pg_dump -Fc -v -p 20293 -U whd whd > whd.pgdump
              • If prompted for DB password use "whd"
            • Mac OS X
              • cd /Library/WebHelpDesk
              • sudo sh -c 'pgsql9/bin/pg_dump -Fc -v -p 20293 -U whd whd > whd.pgdump' (you need to know superuser password)
              • If prompted for DB password use "whd"
            1. Linux (RPM installation)
              • cd /usr/local/webhelpdesk/
              • sudo sh -c 'pgsql9/bin/pg_dump -Fc -v -p 20293 -U whd whd > whd.pgdump'
              • If prompted for DB password use "whd"
            2. Virtual Appliance (Linux)
              • cd /usr/local/webhelpdesk/
              • sudo sh -c 'pgsql9/bin/pg_dump -Fc -v -p 20293 -U whd whd > whd.pgdump'
              • If prompted for DB password use "whd"
          6. Restore PostgreSQL database backup

            1. Windows
              • cd C:\Progra~1\WebHelpDesk
              • pgsql9\bin\pg_restore -Fc -v -p 20293 -U whd -d whd path_to_whd.pgdump
              • If prompted for password use "whd"
            2. Mac OS X
              • cd /Library/WebHelpDesk
              • sudo pgsql9/bin/pg_restore -Fc -v -p 20293 -U whd -d whd path_to_whd.pgdump (you need to know superuser password)
              • If prompted for password use "whd"
            3. Linux (RPM installation)
              • cd /usr/local/webhelpdesk/
              • sudo pgsql9/bin/pg_restore -Fc -v -p 20293 -U postgres -d whd path_to_whd.pgdump
              • If prompted for password use "whd"
            4. Virtual Appliance (Linux)
              • cd /usr/local/webhelpdesk/
              • sudo pgsql9/bin/pg_restore -Fc -v -p 20293 -U postgres -d path_to_whd.pgdump
              • If prompted for password use "whd"
          7. Rename/Drop default empty PostgreSQL embedded database

            1. Windows
              • cd C:\Progra~1\WebHelpDesk
              • Connect to database using pgsql9\bin\psql -p 20293 -U whd -d template1
              • If prompted for password use "whd"
              • Execute following statements:
              • ALTER DATABASE whd rename to whd_old;
              • CREATE DATABASE whd;
              • exit psql tool (\q and Enter)
            2. Mac OS X
              • cd /Library/WebHelpDesk
              • Connect to database using sudo pgsql9/bin/psql -p 20293 -U whd -d template1 (you need to know superuser password)
              • If prompted for password use "whd"
              • Execute following statements:
              • ALTER DATABASE whd rename to whd_old;
              • CREATE DATABASE whd;
              • exit psql tool (\q and Enter)
            3. Linux (RPM installation)
              • cd /usr/local/webhelpdesk/
              • Connect to database using sudo pgsql9/bin/psql -p 20293 -U whd -d template1
              • If prompted for password use "whd"
              • Execute following statements:
              • ALTER DATABASE whd rename to whd_old;
              • CREATE DATABASE whd;
              • exit psql tool (\q and Enter)
            4. Virtual Appliance (Linux)
              • cd /usr/local/webhelpdesk/
              • Connect to database using sudo pgsql9/bin/psql -p 20293 -U whd -d template1
              • If prompted for password use "whd"
              • Execute following statements:
              • ALTER DATABASE whd rename to whd_old;
              • CREATE DATABASE whd;
              • exit psql tool (\q and Enter)
          8. Copy PostgreSQL database backup from original server to target server

            1. Copy to Windows
              • use SMB to copy files between Windows systems or from Mac/Linux/VA to Windows
            2. Copy from Windows to Mac OS X/Linux/VA
              • when copying files from Windows to Mac/Linux/VA you can use pscp utility
              • i.e. to copy files to Virtual Appliance you can use following command
              • <path_to_pscp.exe>\pscp.exe "path_to_whd.pgdump" admin@<IP_address_of_virtual_appliance>:/home/admin
              • if prompted for password use "admin"
            3. Copy files between Mac OS X/Linux/VA
              • scp command can be used to copy files between these systems
              • i.e. to copy files to Virtual Appliance you can use following command
              • scp path_to_whd.pgdump admin@<IP_address_of_virtual_appliance>:/home/admin
              • if prompted for password use "admin"
          9. Rename/Delete entire PostgreSQL database "data folder"

            1. Windows
              • C:\Progra~1\WebHelpDesk\pgsql9\data
              • move source_dir destination
            2. Mac OS X
              • data folder location: /Library/WebHelpDesk/pgsql9/data
              • sudo mv /path/to/source /path/to/dest
            3. Linux (RPM installation)
              • data folder location: /usr/local/webhelpdesk/bin/pgsql/var/lib/pgsql/9.2/data
              • sudo mv /path/to/source /path/to/dest
            4. Virtual Appliance (Linux)
              • data folder location: /data1/pgdata
              • sudo mv /path/to/source /path/to/dest
          10. Copy the entire PostgreSQL database "data folder"

            1. Copy to Windows
              • use SMB to copy files between Windows systems or from Mac/Linux/VA to Windows
            2. Copy from Windows to Mac OS X/Linux/VA
              • when copying files from Windows to Mac/Linux/VA you can use pscp utility
              • i.e. to copy folder to Virtual Appliance you can use following command
              • <path_to_pscp.exe>\pscp.exe -r "path_to_folder" admin@<IP_address_of_virtual_appliance>:/home/admin/.
              • if prompted for password use "admin"
            3. Copy files between Mac OS X/Linux/VA
              • scp command can be used to copy files between these systems
              • i.e. to copy folder to Virtual Appliance you can use following command
              • scp -r path_to_folder admin@<IP_address_of_virtual_appliance>:/home/admin/.
              • if prompted for password use "admin"
            • Re: Migrate DB from OS X 10.6 > vsphere centos
              arig

              Thank you Daniel! Those instructions are very thorough and helpful.

              • Re: Migrate DB from OS X 10.6 > vsphere centos
                arig

                Few notes as you finalize this article, we came across a few errors in the process:

                 

                4. START THE EMBEDDED POSTGRESQL DB

                 

                  1. Windows
                    • net start PostgreSQLServiceWHD
                  2. Mac OS X
                    • cd /Library/WebHelpDesk
                    • ./pg start
                  3. Linux (RPM installation)
                    • cd /usr/local/webhelpdesk/
                    • sudo bin/pgsql/etc/rc.d/init.d/postgresql-9.2 stop
                  4. Virtual Appliance (Linux)
                    • cd /usr/local/webhelpdesk/
                    • sudo bin/pgsql/etc/rc.d/init.d/postgresql-9.2 stop

                This should be start instead of stop in the command line.

                 

                6. RESTORE POSTGRESQL DATABASE BACKUP

                 

                  1. Windows
                    • cd C:\Progra~1\WebHelpDesk
                    • pgsql9\bin\pg_restore -Fc -v -p 20293 -U whd -d whd path_to_whd.pgdump
                    • If prompted for password use "whd"
                  2. Mac OS X
                    • cd /Library/WebHelpDesk
                    • sudo pgsql9/bin/pg_restore -Fc -v -p 20293 -U whd -d whd path_to_whd.pgdump (you need to know superuser password)
                    • If prompted for password use "whd"
                  3. Linux (RPM installation)
                    • cd /usr/local/webhelpdesk/
                    • sudo pgsql9/bin/pg_restore -Fc -v -p 20293 -U postgres -d whd path_to_whd.pgdump
                    • If prompted for password use "whd"
                  4. Virtual Appliance (Linux)
                    • cd /usr/local/webhelpdesk/
                    • sudo pgsql9/bin/pg_restore -Fc -v -p 20293 -U postgres -d path_to_whd.pgdump
                    • If prompted for password use "whd"

                In d. for Virtual Appliance - missing DB name 'whd' after -d should be:

                • sudo pgsql9/bin/pg_restore -Fc -v -p 20293 -U postgres -d whd path_to_whd.pgdump

                 

                 

                 

                Thanks!

                  • Re: Migrate DB from OS X 10.6 > vsphere centos
                    daniel.sykora

                    Thanks for your feedback!! We've corrected the first one already (we found it right after I sent it to you ) so thanks for the second one!!

                     

                    Daniel

                    • Re: Migrate DB from OS X 10.6 > vsphere centos
                      dstellern

                      When I attempt to rename or drop the default data base using these commands

                       

                      1. Virtual Appliance (Linux)
                        • cd /usr/local/webhelpdesk/
                        • Connect to database using sudo pgsql9/bin/psql -p 20293 -U whd -d template1
                        • If prompted for password use "whd"
                        • Execute following statements:
                        • ALTER DATABASE whd rename to whd_old;
                        • CREATE DATABASE whd;
                        • exit psql tool (\q and Enter)

                      It gives me an error on the second command sudo pgsql9/bin/psql -p 20293 -U whd -d template1

                      sql: could not connect to server: No such file or directory

                        Is the server running locally and accepting

                        connections on Unix domain socket "/tmp/.s.PGSQL.20293"?

                       

                      Not sure what the issue is.  I'm new to CentOS and not sure how to proceed from here.  If i try to restore the database as it it just freezes.

                       

                      Thanks

                      1 of 1 people found this helpful