The database dump is accessible via the mount in the directory /var/lib/postgresql/data/.Īs you can see in the output, the restore was not completely successful because of a missing role.Įnter the database, connect to the database postgres with the user mypostgresqldumpplanet. /var/lib/postgresql/data/-original.dmp: The file location of the database dump.-C: Because you have an empty PostgreSQL database, you need to provide the argument -C in order that pg_restore (the backup restore tool) will create the database for you.Because this is an empty instance of PostgreSQL, you use the postgres database, which is always available with the -d argument. -d postgres: you need to provide a database that pg_restore can connect to.-U mypostgresqldumpplanet: the admin database user.Pg_restore: error: could not execute query: ERROR: role "myjhipsterplanet" does not existĬommand was: ALTER DATABASE myjhipsterplanet OWNER TO myjhipsterplanet Pg_restore: from TOC entry 3382 1262 16384 DATABASE myjhipsterplanet myjhipsterplanet $ pg_restore -U mypostgresqldumpplanet -d postgres -C /var/lib/postgresql/data/-original.dump The popup will show various options, including 'Format', select 'plain' and you get plain SQL. The PostgreSQL data is mounted to the directory ~/docker/volumes/postgresqldata. The Docker Compose file will start a PostgreSQL database containing a basic setup where the default admin user postgres is replaced with a user mypostgresqldumpplanet. To back up an existing PostgreSQL database on-premises or in a VM, run the following command: pgdump -Fc -v -host -username -dbname -f .The pgdump command provides several options. The database backup and Docker Compose file used in this section are available at GitHub. Create a dump file that contains the data to be loaded. The pgdump is a command-line tool that allows you to dump the content of a specified database into a single file. Skip this section if you just want to know how to use the backup and restore commands. In this section, a database is prepared, which you will use to backup and restore.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |