- Built out NetBox on a VM; up and running with no info in the db
- Upgraded old serve; UI broke
- Trying to work around by salvaging what I can from the old DB and dumping it over on the new machine.
- Here is what I have done so far:
-- mkdir -p /var/backup/netbox
-- chmod 700 /var/backup/netbox
-- su -c 'pg_dump' postgres | gzip -9 > /var/backup/netbox/netbox.$(date +%Y%m%d%H%M).gz
Then I was having some issues with scp, so I ended up using pscp to copy the compressed file old server > local machine and then local machine > new server
and then ran:
gzip -dc /var/backup/netbox/netbox.201806110828 | | su -c 'psql netbox' postgres
Output of the above command is below:
-- PostgreSQL database dump
--
-- Dumped from database version 9.5.8
-- Dumped by pg_dump version 9.5.8
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: postgres; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON DATABASE postgres IS 'default administrative connection database';
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--
netbox@netbox:/$
Still nothing, is there something I am doing wrong? any recommendations?
-TIA